



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various exercises and questions related to arrays and linked lists. Topics covered include determining dimensions and sizes, accessing array elements, rectifying incorrect scores, deleting elements from arrays and linked lists, and analyzing the complexity of algorithms. The document also includes exercises on inserting data in linked lists and calculating the worst and average-case times for stack methods.
Typology: Exercises
1 / 5
This page cannot be seen from the preview
Don't miss anything!




LINKED LIST
1. HEAD given the following linked list. If we perform these four operations: i i. Insert “SHEEP” after “COW”. ii ii. Delete the last element. iii iii. Insert “BULL” at the front of the list. iv iv. Insert “SNAKE” at the end of the list. With the diagram, show the state of the list after each operation above and after the fourth operation: a. What does HEAD point to? b. What does the element with data value “DOG” points to? c. What is the last element? d. Which element points to “PIG”?
OPERATION WORST-CASE TIME AVERAGE-CASE TIME PEEK POP PUSH IS EMPTY IS FULL