The concatenation of two lists is to be performed in O(1) time. Which of the…

2023

The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list should be used?

  1. A.

    singly linked list

  2. B.

    doubly linked list

  3. C.

    circular doubly linked list

  4. D.

    array implementation of lists

Attempted by 302 students.

Show answer & explanation

Correct answer: C

Explanation:

Singly linked list cannot be answer because we cannot find last element of a singly linked list in O(1) time. Doubly linked list cannot also not be answer because of the same reason as singly linked list.

Explore the full course: Coding For Placement