Please follow the above (state why you chose the answer and why it is better tha
ID: 3887783 • Letter: P
Question
Please follow the above (state why you chose the answer and why it is better than the others...if the other choices flat out would not work...explain why)
Of the three variations of linked lists (circular, with header and trailer nodes, and doubly linked), which would be most appropriate for each of the following applications? Why? In each case, what are the benefits of choosing one method over another? 1. You want to search a list for a key and return the keys of the two elements that come before it and the keys of the 2. A text file contains integer elements, one per line, sorted from smallest to largest. You must read the values from the 3. A list is short and frequently becomes empty. You want a list that is optimal for inserting an element into the empty two elements that come after it. file and create a sorted linked list containing the values list and deleting the last element from the list.Explanation / Answer
Answer:-
1. Doubly Link List
because in doubly link list we can move in both direction,
In the given situation we are giving the key to two element before and after so we are using Doubly Link List for the movement because doubly list can move in both direction means it can give the address of the elements before and after of the given element
2. Circular
In the given condition the elements are already sorted from small to larger we just have to read the value from the file and create a sorted linked list containing the values so we use Circularr linked list
3. Header and trailer node
In the given situation we have to insert the element and delete the last element from the list it is done if Ii have the address of the head and the tail element so we use Header and trailer node linked list .
Kindly rate my answer Thank you