Question: (b) Assume that this ADT has two different different methods to delete all the elements from the singly linked list as follows: i void delete_all_from_start()

 (b) Assume that this ADT has two different different methods to

(b) Assume that this ADT has two different different methods to delete all the elements from the singly linked list as follows: i void delete_all_from_start() 2 { while (size > 0) delete-nth (0) 3 4 5 return 6} 7 10 8 void delete_all_from_end () 9{ while (size > 0) delete-nth ( size 1) return 13 } 11 12 Give the complexities of these two methods in big O notation and explain how you derived them. Write the pseudocode for a much simpler and more efficient method to delete all elements from the list. [10 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!