This project is built using python to register or unregister a student to a course in which Linked list data structure is implemented.
Below are examples the data used:
colleges = [{"id": 1, "name": "Agriculture" }, { "id": 2, "name": "Medicine" }]
departments = [{"id":1,"name":"dept1","collegeId":1},{"id":2,"name":"dept2","collegeId":1}]
courses = [{"id": 1,"name": "crs 1","departmentId": 1, "firstNode": None}, {"id": 2,"name": "crs 2", "departmentId": 1 , "firstNode": None}]
students = [{"id": 1,"name": "Sophia Alvarez","departmentId": 1 , "firstNode": None}, { "id": 2, "name": "Jerry Powell", "departmentId": 1 , "firstNode": None}]
Other values are as college Id, Department Id, grade
UI.ipynb | The file that the user deal with within JupyterLab | ||||||||||||||||
registrationNode.py | The node class | ||||||||||||||||
registrationLL.py | The Linked List class having the following functions:
|
||||||||||||||||
Helper.py | A class having functions to help in logic; it is used from UI.ipynb to call functions in registrationLL.py
|
And below is the algorithm used to get the registered students in a course (getting the courses registered by a student uses same algorithm with only different inputs and variables)
Assume having the below registrations: rows are students, cols are courses
_ | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|
1 | * | * | * | ||||
2 | * | * | * | * | |||
3 | * | * | * | * | |||
4 | * | * | * | * | |||
5 | * | * | * | * |
First importing that Helper class
from helper import Helper
creating an instance of the Helper Class
helper = Helper(colleges, departments, students, courses)
To add registration e.g: passing student Id, Course Id
helper.addNewRegister(1, 2)
to get total # of registrations:
helper.getAllRegistrationsDone()
To get list & count of students registered in a course: passing course Id
helper.getRegisteredStudentsInCourse(5)
To get list & count of courses registered by a student: passing student Id
helper.getCoursesRegisteredByStudent(7)
To delete a registration: passing student Id, Course Id
helper.deleteRegistration(3, 3)