Question

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

Option 2 : 6, since 2^6 ≤ 100 < 2^7 and height = floor(log₂100) / 6, क्योंकि 2^6 ≤ 100 < 2^7 और ऊँचाई = floor(log₂100)

Advertisement

Detailed Solution

सही उत्तर 6, since 2^6 ≤ 100 < 2^7 and height = floor(log₂100) / 6, क्योंकि 2^6 ≤ 100 < 2^7 और ऊँचाई = floor(log₂100) है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

A complete binary tree contains exactly 100 nodes. Its height, measured in edges on the longest root-to-leaf path, is / एक पूर्ण बाइनरी वृक्ष में ठीक 100 नोड हैं। सबसे लंबे मूल-से-पत्ती पथ पर किनारों में मापी गई इसकी ऊँचाई है

1.
5, by wrongly using the perfect-tree formula 2^h − 1 = 100 / 5, पूर्ण-वृक्ष सूत्र 2^h − 1 = 100 का गलत प्रयोग करके
2.
6, since 2^6 ≤ 100 < 2^7 and height = floor(log₂100) / 6, क्योंकि 2^6 ≤ 100 < 2^7 और ऊँचाई = floor(log₂100)
3.
7, by counting levels starting from 1 and adding one / 7, स्तरों की गिनती 1 से शुरू करके एक जोड़ने से
4.
99, confusing height with the number of nodes minus one / 99, ऊँचाई को नोड-संख्या ऋण एक समझने से

Correct Answer: 6, since 2^6 ≤ 100 < 2^7 and height = floor(log₂100) / 6, क्योंकि 2^6 ≤ 100 < 2^7 और ऊँचाई = floor(log₂100)

A complete tree with n nodes has height floor(log₂n); floor(log₂100) = 6, consistent with levels 0–6 holding up to 127 nodes. Counting nodes or misapplying the perfect-tree formula gives the distractors. / n नोड वाले पूर्ण वृक्ष की ऊँचाई floor(log₂n) होती है; floor(log₂100) = 6, जो 0–6 स्तरों (अधिकतम 127 नोड) के अनुरूप है। नोड गिनने या पूर्ण-वृक्ष सूत्र के दुरुपयोग से भ्रामक विकल्प बनते हैं।

Downloaded from PrepSnap (prepsnap.in)