Question 49Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

Consider a singly linked list containing n elements in which A is the address of the

Consider a singly linked list containing n elements in which A is the address of the starting node of the linked list. If we first convert the linked list to an array, then sort the array elements, and then create a new linked list from the elements of the sorted array, what is the number of operations required to traverse the linked list and store its data values ​in an additional array before applying sorting?
  1. AO(n log n)
  2. BO(log n)
  3. CO(n)
  4. DO(n²)
Show answerHide answer

Correct answer: (C) O(n)

Explanation

Copying the data needs a single pass through the list, visiting each of the n nodes once, so it takes O(n) operations. The later sorting step is what needs O(n log n).

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

This is question 49 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM). 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.