Which of the following statements is/are true? P: The size of a linked list can grow and shrink dynamically during runtime based on
Which of the following statements is/are true?
P: The size of a linked list can grow and shrink dynamically during runtime based on
the operations performed.
Q: Unlike arrays, linked lists allow for constant-time access to elements by index.
R: The dynamic nature of linked lists means that memory for nodes is allocated only
when necessary, leading to better space utilisation.
Show answerHide answer
Correct answer: (C) Only P and R
Explanation
P is true (lists grow and shrink at run time) and R is true (nodes are allocated only when needed). Q is false: linked lists need O(n) traversal to reach an index; arrays give constant-time indexed access.