Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 2 : 4 / 4

Advertisement

Detailed Solution

सही उत्तर 4 / 4 है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

In the singly linked list 1 → 2 → 3 → 4 → 5 → 6, the slow pointer (1 step) and fast pointer (2 steps) both start at node 1. When the fast pointer can no longer move, the slow pointer is at node: / एकल लिंक्ड सूची 1 → 2 → 3 → 4 → 5 → 6 में धीमा पॉइंटर (1 कदम) और तेज पॉइंटर (2 कदम) दोनों नोड 1 से शुरू करते हैं। जब तेज पॉइंटर आगे नहीं बढ़ सकता, तब धीमा पॉइंटर नोड पर है:

1.
3 / 3
2.
4 / 4
3.
5 / 5
4.
2 / 2

Correct Answer: 4 / 4

Pointer pairs (slow, fast): (1,1) → (2,3) → (3,5) → (4, end); fast stops and slow = 4 — the standard middle-finding trick. / पॉइंटर युग्म (slow, fast): (1,1) → (2,3) → (3,5) → (4, अंत); तेज रुकता है और slow = 4 — मानक मध्य-खोज युक्ति।

Downloaded from PrepSnap (prepsnap.in)