Data Structure
Data Structure
Data Structures
and Algorithms
University Management System
Lecture
Student name
2. MAIN FUNCTIONS 2
5. TEST CASES 12
WORK BREAKDOWN STRUCTURE 18
1
1. INTRODUCTION ABOUT PROJECT
This project was created using C++ and relies on a double linked list as its main data structure,
coupled with a text database for storing and accessing relevant details. The utilization of a double
linked list brings several advantages to the organization of student and teacher information. It
ensures effective memory management, speedy data search and retrieval, and straightforward
data insertion and deletion. Additionally, employing a text database facilitates easy data storage
and retrieval, enhancing the system's scalability and flexibility.
In summary, the VNU-IS Management System project proves to be a valuable tool for
universities and academic institutions seeking to streamline administrative and academic
processes related to student and teacher management. It provides a comprehensive and efficient
solution for handling student and teacher information, contributing to the enhancement of
education quality and administrative efficiency.
2. MAIN FUNCTIONS
2.1. Insert a new record
These part of code implement the addition of student and teacher records to a linked list in a
system. The `addStudent()` function starts by creating a new student node, prompting the user
to input various details such as ID, name, course, date of birth, address, and unpaid course
credits. It then appends this new node to the linked list, updating pointers accordingly. The
function handles scenarios where the list is initially empty or contains existing records.
Similarly, the `addTeacher()` function follows a comparable process for teacher records. It
allocates memory for a new teacher node, collects information like ID, name, date of birth,
address, and the number of classes taught, and integrates the new node into the linked list.
This accommodates cases where the teacher list is either empty or populated.
2
For student For teacher
Both functions ensure that the new records are appropriately linked within the system, updating
pointers and notifying the user of the successful addition of either a student or teacher. These
capabilities contribute to the effective management of student and teacher information within the
system.
3
2.2. Remove a student/teacher record
The code first checks if the list is empty. If it is, it prints a message and returns. Otherwise, it
prompts the user to enter the ID of the record to be removed.
Next, the code uses a pointer to iterate through the list, comparing the ID of each record to the
ID that the user entered. If a match is found, the code takes the following steps:
If the record is the first or last element in the list, the code simply updates the pointers to
the first or last element, respectively.
If the record is in the middle of the list, the code updates the pointers of the previous and
next records to point to each other, effectively removing the record from the list.
Finally, the code deletes the record from memory and prints a message indicating that the
removal was successful.
4
2.3. Search for Teacher/Student Record by ID.
For teacher
This function needs two things to work: the head of the linked list and the teacher ID you
want to find. It starts by setting a temporary variable, "current," to the linked list's head.
Then, it goes through the list using a while loop until it either reaches the end or finds the
node with the given teacher ID. If it finds a match, the function shows details about the
teacher, like their ID, name, department, birthdate, and salary. If it checks the entire list
without finding the teacher with that ID, it says the specified teacher wasn't found.
For student
The function also works with two things: a pointer pointing to the linked list's head and the
student ID you want to find. It starts by setting a temporary variable, "current," to the head
of the linked list. Then, it checks each node using a while loop until it either reaches the end
or discovers the node with the specified student ID. If there's a node with the matching ID,
the function shows the student's details, like ID, name, course, birthdate, and unpaid
credits. If it goes through the whole list without finding a node with the desired student ID, it
says that the specified student wasn't found.
5
2.4. Modify Student/Teacher Record.
The code includes functions to update student and teacher records in the system.
The updateStudentRecord() function checks if the student list is empty, and if not,
allows the user to input a student ID for updating. It then prompts the user to
choose the field to update and accepts new information accordingly. Similarly, the
updateTeacherRecord() function performs the same process for teacher records.
Both functions notify the user of the successful update or if no corresponding
record is found. This capability enhances the management system's flexibility by
enabling the modification of student and teacher details as needed.
6
2.5. Check debt of student
The debt checking process involves the user entering the ID of the student to be examined. The
program then iterates through the list of students to find the one with the corresponding ID. Upon
locating the student, it calculates the debt based on the unpaid credits and displays the relevant
information. If the student is not found, the program notifies that there is no debt information for that
particular student.
Enter Student ID
The user is asked to enter the ID of the
student whose debt needs to be
checked.
Export results
If a student with a corresponding
ID is found, export debt
information.
If not found, output a student not
found message.
Export results
If a teacher with a corresponding ID is
found, export salary information.
If not found, output a message saying the
teacher could not be found. 7
2.7. Filter function
Our code implements the functionality to filter information about students and
teachers in a university management system. Utilizing two functions, filterStudent()
and filterTeacher(), users can input a search keyword through the getline(cin,
keyword` function. The system then traverses through the lists of students and
teachers to find records that match the entered keyword. Detailed information about
students and teachers, including ID, name, date of birth, address, and other relevant
details, is displayed on the console. The final result is indicated by the message "End
of filtered records," aiding users in easily identifying the conclusion of the filtering
process. The use of getline(cin, keyword) along with keyword verification through
find(keyword) provides a flexible and convenient filtering module for specific
information retrieval within the system.
For teacher
For student
8
2.8. Safety of the system
Making sure our project is safe is super important, especially because it deals with private info
of students and teachers. To keep things secure, we use strong security steps, like needing a
special username and password when logging in. This two-step check doesn't just make our
stored info private, but it's a big wall against people who shouldn't get in. By putting these safety
steps first, we're focused on building a reliable and trustworthy space to handle student and
teacher info in our project.
9
3. ALGORITHMS DESIGN
False
False
10
4. COMPLEXITY ALGORITHMS
The time complexity of an algorithm is a general way to measure how fast it runs on a specific
amount of data. It's like checking how long it takes for the algorithm to finish a task given a
certain amount of data. We often use big O notation to describe this, which tells us the
maximum time an algorithm might take, no matter the size of the data.
In our project, all the functions we use have a time complexity of O(n). This means that as the
amount of data gets bigger, the time it takes for the algorithm to finish also increases in a
straight line. So, if we double the data size, the time it takes will roughly double too.
Functions for adding students and teachers (addStudent and addTeacher) both have a time
complexity of O(1). This is because both functions only involve creating a new record and
updating pointers, regardless of the current number of records.
However, functions for removing students and teachers (removeStudent and removeTeacher)
have a time complexity of O(n). Removing requires traversing the entire doubly-linked list to
find and delete the corresponding record, and in the worst case, all n records must be visited.
Searching for students and teachers (searchStudent and searchTeacher) also has a time
complexity of O(n). Both functions need to traverse the linked list to find the desired record.
Record filtering functions (filterStudent and filterTeacher) have a time complexity of O(nm),
where m is the average length of fields in the record. Both functions need to examine each
record to check if the keyword appears in different fields.
Lastly, checking student debt and teacher salary (checkDebt and checkSalary) also have a
time complexity of O(n). Both functions require traversing the linked list to find the specific
record.
Using this approach, we assess that all functions in the project code exhibit a time complexity
of O(n), where n is the number of input elements. With this design, the project has been
optimized for performance, enabling efficient handling of mass data and tasks.
11
5. TEST CASES
5.1 Check Login Of Admin
12
5.2 Insert a new record
13
5.3 Check student’s debt function
Input Expected Output Actual Output Status
ID:12 ID: 12
List with multiple node Name: john Name: john
containing Student Course: math Course: math
Pass
IDs: 12,3,4 Date Of Birth: 26-08 Date Of Birth: 26-08
Student ID: 12 Address: Thai Binh Address: Thai Binh
Unpaid Credits: 2 Unpaid Credits: 2
16
5.8 Filter function
Input Expected Output Actual Output Status
ID: 12 ID: 12
List with multiple node Name: john Name: john
containing Course: math Course: math
Pass
Student IDs: 12,3,4 Date Of Birth: 26-08 Date Of Birth: 26-08
Keyword to search: 12 Address: Thai Binh Address: Thai Binh
Unpaid Credits: 2 Unpaid Credits: 2
ID: 4 ID: 4
List with multiple node
Name: Lisa Name: Lisa
containing
Course: Computer Course: Computer
Student name: "Mike, Pass
Date Of Birth: 25-09 Date Of Birth: 25-09
John, Lisa"
Address: Ha Noi Address: Ha Noi
Keyword to search: Lisa
Unpaid Credits: 0 Unpaid Credits: 0
17
WORK BREAKDOWN STRUCTURE
Name Contribution %
Update
Nguyen Hoang Anh function 20
Main function
Slide
Ha Thi Hong Anh Remove 20
function
Report
Nguyen Bich Diep 20
Add function
Search function
Tran Viet Dung 20
Filter function
Test case
Nguyen Quang Phuc Check 20
debt/salary
18