In: Computer Science
1. Answer “True” or “False”.
(a) A doubly linked list structure is worse than a singly linked list if we plan to do a lot of insertions.
(b) A doubly linked list structure is worse than a singly linked list if we plan to do a lot of deletions.
(c) A doubly linked list structure is worse than a singly linked list if we plan to print the entire list frequently.
(d) An array implementation of a queue is more difficult to manage than the array implementation of a stack.
Solution:
(a) A doubly linked list structure is worse than a singly linked list if we plan to do a lot of insertions. => True, Because Doing the insertion in doubly linked list requires managing four pointer (2 from the new node, one each from previous and next node) Hence it is more difficult. (b) A doubly linked list structure is worse than a singly linked list if we plan to do a lot of deletions. => True, As doing the lot of deletions means, managing four pointers for removing a particular node.. in case of single linkedlist, we just need to manage only two pointer, Hence it becomes easy. (c) A doubly linked list structure is worse than a singly linked list if we plan to print the entire list frequently. => False, A single or double linked list perform in same way when printing the list in one direction. However, if we plan to print the list in reverse order, then double linkedlist is better. (d) An array implementation of a queue is more difficult to manage than the array implementation of a stack. => True. An Stack grows/shrinks only on one end(right end), due to which, It is easy to manage the stack.. However, the queue grows and shrink in both ends (enqueue/dequeue) operation, due to which it becomes difficult to manage the queue.
************************************************** Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.