Under the standard textbook comparison of arrays and linked lists, with the…

2018

Under the standard textbook comparison of arrays and linked lists, with the insertion or deletion position already known, which statement is NOT true?

Answer: C. Both, random access and direct access are allowed in a linked list.ConceptArrays store elements in contiguous positions and support constant-time indexed access. Their capacity is commonly fixed for the textbook comparison.…

  1. A.

    The size of an array is generally fixed, whereas the size of a linked list is dynamic.

  2. B.

    Inserting a new element in an array is expensive compared to inserting a new element in a linked list.

  3. C.

    Both, random access and direct access are allowed in a linked list.

  4. D.

    Deleting an element from array is expensive compared to deleting an element from a linked list.

Attempted by 1797 students.

Show answer & explanation

Correct answer: C

Concept

Arrays store elements in contiguous positions and support constant-time indexed access. Their capacity is commonly fixed for the textbook comparison.

Linked lists store nodes connected by links. They grow dynamically, but reaching the node at a given index requires following links sequentially.

Application

Apply those structural rules to each statement:

  • Fixed array capacity versus dynamic linked-list growth follows the standard storage model.

  • At a known insertion position, an array may shift later elements, whereas a linked list changes links.

  • Random or direct indexed access is not available in a linked list; index i is reached by traversing earlier nodes.

  • At a known deletion position, an array may shift later elements, whereas a linked list unlinks the node.

Cross-check

To retrieve index i, an array computes an address directly, but a linked list must visit nodes from its head until it reaches i. Thus the statement claiming random and direct access for linked lists is the statement that is not true.

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…