1. What operation is supported in constant time by the doubly linked list, but n
ID: 3594622 • Letter: 1
Question
1. What operation is supported in constant time by the doubly linked list, but not by the singly linked list?
1. advance
2. search for a node
3. first
4. retreat to previous node
2. The Unix editor vi allows searching in both directions, with wraparound if necessary. If the sequence of lines is stored as a linked list, which of the following is most reasonable?
1. doubly linked list
2. circular doubly linked list
3. singly linked list
4. circular singly linked list
3. Consider an operation in which you need to return the elements immediately preceding and following a given item x. Which variation of lists would be most appropriate?
singly linked list with header and trailer nodes
2. circular list
singly linked list
4. doubly linked list
1. advance
2. search for a node
3. first
4. retreat to previous node
Explanation / Answer
1 Answer) 4. retreat to previous node
Explanation:- By using doubly linked list we can reiterate to the previous node in constant time because in doubly linked list we store the references to both the previous and succeding nodes which is not done in single linked list
2 Answer) 2. circular doubly linked list
Explanation:- By using the circular doubly linked list we search forward or backward as we have references to both the previous and next nodes from the current node. And we can wraparound also as it is a circular list.
3 Answer) 4. doubly linked list
Explanation:- By using doubly linked list we can return the previous and next nodes easily because in doubly linked list we store the references to bith the previous and succeding nodes which is not done in single linked list
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.