OA. free
Free
Qualcomm Digital Electronics Digital Electronics Medium

Consider a circular singly linked list having elements: x y z.

Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Consider a circular singly linked list having elements: x y z. What will be the sequence of elements after performing the below given operations on the circular singly linked list?

Operations:

I) Insert 'a' after 'z'.
II) Delete 'y'.
III) Insert 'p' before 'x'.

Choose one option.
Show answer & explanation
Answer: B. p x z a

In a circular singly linked list, after inserting 'a' after 'z', deleting 'y', and inserting 'p' before 'x', the traversal starting from any node follows the circular structure. Starting from 'p' (the newly inserted head), the sequence is: p → x → z → a → (back to p). This gives the order p x z a.

Step-by-step Derivation:
Initial state: x → y → z → (back to x)

Operation I - Insert 'a' after 'z':
x → y → z → a → (back to x)

Operation II - Delete 'y':
x → z → a → (back to x)

Operation III - Insert 'p' before 'x':
p → x → z → a → (back to p)

Traversing from head 'p' in circular order: p, x, z, a