Question 150

Inserting a node at the beginning of a singly linked list takes:

  1. AO(1)
  2. BO(n^2)
  3. CO(n)
  4. DO(log n)
Show answerHide answer

Correct answer: (A) O(1)

Explanation

Only the head pointer changes.

From DSSSB TGT Computer Science Full Mock Test 2

This is question 150 of DSSSB TGT Computer Science Full Mock Test 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.