Ministry of Manpower
Nizwa College of Technology
Department of Information Technology
Course Code: ITSE205/ITSE3101 – Lecturer Name: T V Sathyanarayana/ Sonia V Soans
Course Title: Data Structure and Algorithms
Semester: ( III ) 2018 – 2019
Activity (Tracing the Algorithm)
Perform the following operations on the Singly Linked List:
45 1200 5 2200 66 NULL
1010 1200 3430
start trv
76 NULL
4355
temp
1. What is the value for the following as per the InsertAtLocation() algorithm where
loc is 2?
a. temp ->next:___________________
b. trv ->next:_____________________
4 2300 25 5670 96 NULL
3125 2300 5670
start trv temp
2. What is the value for the following as per the deleteAnyMiddleNode() algorithm
where data is 25?
a. trv ->next:___________________
b. temp->next:_____________________
Page 1 of 3
Ministry of Manpower
Nizwa College of Technology
Department of Information Technology
Course Code: ITSE205/ITSE3101 – Lecturer Name: T V Sathyanarayana/ Sonia V Soans
Course Title: Data Structure and Algorithms
Semester: ( III ) 2018 – 2019
45 1200 5 2200 66 NULL
1010 1200 3430
start trv
76 NULL
4355
temp
3. What is the value for the following as per the InsertAsEnd() algorithm ?
a. trv->next:___________________
b. temp:_____________________
45 1200 5 2200 66 NULL
1010 1200 3430
start
76 NULL
4355
temp
4. What is the value for the following as per the InsertAsStart() algorithm?
a. temp ->next:___________________
b. start:_____________________
c. Temp:_________________________
Page 2 of 3
Ministry of Manpower
Nizwa College of Technology
Department of Information Technology
Course Code: ITSE205/ITSE3101 – Lecturer Name: T V Sathyanarayana/ Sonia V Soans
Course Title: Data Structure and Algorithms
Semester: ( III ) 2018 – 2019
45 1200 5 2200 66 NULL
1010 1200 3430
start trv
5. What is the value for the following as per the deleteFirstNode() algorithm?
a. trv:___________________
b. start:_____________________
45 1200 5 2200 66 NULL
1010 1200 3430
start
trv temp
6. What is the value for the following as per the deleteLastNode() algorithm?
a. trv:___________________
b. temp:_____________________
Page 3 of 3