Inserting a node at the beginning of a singly linked list takes:
Show answerHide answer
Correct answer: (A) O(1)
Explanation
Only the head pointer changes.
Correct answer: (A) O(1)
Explanation
Only the head pointer changes.
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.