Question discussion

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 oper…

358879Medium DSSSB TGT Computer Science 0 replies 0 views
0
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.
  • AP, Q, R
  • BOnly P and Q
  • COnly P and R
  • DOnly P
Correct answer: C

Explanation

P and R are true: a linked list grows and shrinks at run time and allocates nodes only when needed. Q is false because linked lists need sequential traversal, so access by index is not constant time.

Discussion 0

Nobody has replied yet. Start the discussion!