Question
1.
2.
3.
4.
Answer (Detailed Solution Below)
Option 2 : 50 40 20 70 60 80
Advertisement
Detailed Solution
सही उत्तर 50 40 20 70 60 80 है।
Key Points
Helpful?
Question:
In the BST built by inserting 50, 30, 70, 20, 40, 60, 80 (in that order), the key 30 is deleted using the inorder-successor replacement. What is the preorder traversal of the tree after deletion? / 50, 30, 70, 20, 40, 60, 80 (इसी क्रम में) डालकर बने BST से कुंजी 30 को इनऑर्डर-उत्तराधिकारी प्रतिस्थापन से हटाया जाता है। हटाने के बाद ट्री का प्रीऑर्डर ट्रैवर्सल क्या है?
1.
50 20 70 60 80
2.
50 40 20 70 60 80
3.
50 40 20 70 80 60
4.
40 20 50 70 60 80
Correct Answer: 50 40 20 70 60 80
Node 30 has two children; its inorder successor is 40, which replaces 30 with left child 20. Preorder: 50, 40, 20, 70, 60, 80. / नोड 30 के दो बच्चे हैं; इसका इनऑर्डर उत्तराधिकारी 40 है, जो बाएँ बच्चे 20 के साथ 30 का स्थान लेता है। प्रीऑर्डर: 50, 40, 20, 70, 60, 80।
Downloaded from PrepSnap (prepsnap.in)