Fall 2026–2027
CSE111
CSE111 • Data Structures • Fall 2026–2027
Due Thursday, 5 November 2026, 23:59
Task 1
The class list
1 The story
Thursday evening. The department office is still open, and the CSE111 class is a line of students.
1. Student 20 arrives and stands alone.
2. Student 10 is late and stands at the front: 10, then 20.
3. Students 30 and 40 stand at the end: 10, 20, 30, 40.
4. Presentation day turns the line around: 40 speaks first.
5. Student 20 leaves. The line is 40, 30, 10.
You write the whole program yourself. This sheet is the only file you receive.
Hint. This is a singly linked list. Each student is one node: a number, and one link, Next, to the student behind. The list keeps the first node, the last node, and the count. Change those links to enroll,
drop, or reverse. Save the next node before you overwrite Next. Do not use an array or List<T>.
2 What you create
One C# console project. Two classes, both in the namespace Cse111Task1.
Student — one node
int Id, Student?
Next, and a constructor that receives the id.
StudentList — the line
Student?
First, Student?
Method
Time
What it does
AddFront(id)
O(1)
O(1)
O(n)
Put this student at the front. On an empty line, this student is also last.
Put this student at the end. Use Last. Do not walk the line.
Drop the first match. Return true if someone left. Cover empty, one student, first,
middle, last, and missing.
Turn the line around. No extra array. Save Next before you change it.
Write the ids from first to last, separated by spaces.
AddEnd(id)
Remove(id)
Reverse()
Print()
O(n)
O(n)
Last, and int Count.
After every change, First, Last, and Count must match the line. An empty line and a line of one
student must reverse safely. Reverse twice must restore the original order.
3 Check the story
Call the methods in this order. Your program must reach the last row.
CSE111 • Data Structures • Fall 2026–2027
1
Fall 2026–2027
CSE111
Step
Call
Line
first
last
count
0
1
2
3
4
5
6
start
empty
20
10 → 20
10 → 20 → 30
10 → 20 → 30 → 40
40 → 30 → 20 → 10
40 → 30 → 10
null
20
10
10
10
40
40
null
20
20
30
40
10
10
0
1
2
3
4
4
3
AddFront(20)
AddFront(10)
AddEnd(30)
AddEnd(40)
Reverse()
Remove(20)
4 Hand it in
1. Put your name and student ID in a comment at the top of StudentList.cs.
2. Create a GitHub repository named CSE111-Task1- followed by your student ID.
Example: CSE111-Task1-20240017.
3. Upload Student.cs and StudentList.cs.
4. If the repository is private, add khaled-elsaeed as a collaborator before 23:59.
5. Paste the repository link in the form.
Form
https://forms.gle/VEAbAb5s5p6DFWV5A
Full name, academic ID, and the GitHub link. Before Thursday, 5 November 2026, 23:59.
Work is not accepted by email or on paper. Late work is late. Hidden tests score the list (90 points).
The name and student-ID comment are worth 10.
Khaled Zahran • khaled.zahran@nmu.edu.eg • github.com/khaled-elsaeed • Sun–Wed, 09:00–16:00
Integrity. Talk about the idea. Write your own classes. Do not send your files to another student.
CSE111 • Data Structures • Fall 2026–2027
2