Question

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

Option 2 : 2

Advertisement

Detailed Solution

सही उत्तर 2 है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

In a doubly linked list, given only a pointer to a node that is neither the head nor the tail, how many pointer adjustments are needed to delete that node? / द्वि-लिंक्ड लिस्ट में, जब केवल ऐसे नोड का पॉइंटर दिया गया हो जो न head है न tail, तो उस नोड को हटाने के लिए कितने पॉइंटर समायोजन आवश्यक हैं?

1.
1
2.
2
3.
3
4.
4

Correct Answer: 2

Only two links change: node.prev.next is set to node.next, and node.next.prev is set to node.prev. The node itself can then be freed. / केवल दो लिंक बदलते हैं: node.prev.next को node.next पर और node.next.prev को node.prev पर सेट किया जाता है। फिर नोड को मुक्त किया जा सकता है।

Downloaded from PrepSnap (prepsnap.in)