Question:medium

Consider a procedure LIST-SEARCH (L, K) finds the first element with key K in list L by simple linear search, returning a pointer to its element. Arrange the following according to correct order of execution.
• [A.] x = L.head
• [B.] while x $\neq$ NIL and x.key $\neq$ K
• [C.] return x
• [D.] x = x.next
Choose the correct answer from the options given below:

Show Hint

Traversal always follows: Initialize → Check → Move → Return.
Updated On: Jun 5, 2026
  • A, B, D, C
  • B, C, D, A
  • A, D, B, C
  • A, B, C, D
Show Solution

The Correct Option is A

Solution and Explanation

Was this answer helpful?
0


Questions Asked in CUET (PG) exam