PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Binary Tree: Definition, Properties and Maximum Nodes Formulas (बाइनरी ट्री: परिभाषा, n लेवल्स पर अधिकतम नोड्स (2^n) सूत्र) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।
Overview: A Binary Tree is an ordered hierarchical tree where every node has at most two children, strictly distinguished as Left Child and Right Child. Key mathematical bounds govern capacity and shape: at most 2^i nodes at 0-based level i, up to 2^(h+1) - 1 total nodes for edge-height h (or 2^n - 1 across n levels), minimum height floor(log2(N)), and the universal degree invariant n0 = n2 + 1.
अध्याय सार: बाइनरी ट्री एक क्रमित पदानुक्रमित ट्री है जहाँ प्रत्येक नोड के अधिकतम दो बच्चे—बायां (Left) और दायां (Right)—होते हैं। इसके प्रमुख गणितीय सूत्र हैं: 0-आधारित लेवल i पर अधिकतम 2^i नोड्स, ऊंचाई h पर कुल अधिकतम 2^(h+1) - 1 (या n लेवल्स पर 2^n - 1) नोड्स, N नोड्स पर न्यूनतम ऊंचाई floor(log2(N)), तथा पत्ती संबंध n0 = n2 + 1।
Binary Tree: Definition, Properties and Maximum Nodes Formulas: Detailed Notes & Architecture (बाइनरी ट्री: परिभाषा, n लेवल्स पर अधिकतम नोड्स (2^n) सूत्र)
1. Ordered Left/Right Child Definition vs General Tree (बायां व दायां क्रमित चाइल्ड नियम बनाम सामान्य ट्री)
[EN] In an unordered general tree, a single child is indistinguishable regardless of orientation. In a Binary Tree, every node holds two distinct ordered slots—Left Child and Right Child—so a root with only a Left Child is structurally a DIFFERENT binary tree from a root with only a Right Child. Moreover, unlike general graph-theory trees requiring >= 1 vertex, a Binary Tree is recursively defined so an Empty Tree (0 nodes) is completely valid.
[HI] सामान्य अनियमित ट्री के विपरीत, बाइनरी ट्री में बच्चों का क्रम (Left बनाम Right) महत्वपूर्ण होता है। यदि रूट के पास केवल एक बायां बच्चा है तो वह ट्री केवल एक दाएं बच्चे वाले ट्री से संरचनात्मक रूप से बिल्कुल भिन्न माना जाता है। इसके अतिरिक्त, रिकर्सिव परिभाषा में खाली ट्री (0 नोड्स) भी एक वैध बाइनरी ट्री होता है।
2. Maximum Nodes Formulas: Per Level (2^i) vs Total Tree (2^n - 1) (अधिकतम नोड्स सूत्र: प्रति स्तर (2^i) बनाम कुल नोड्स (2^n - 1))
[EN] Starting with 1 Root at Level 0 (0-based), each node branches at most twice, yielding at most 2^i nodes at level i (or 2^(k-1) if levels start at 1). Summing the geometric series across levels 0 through height h gives maximum total nodes N_max = 1 + 2 + 4 + ... + 2^h = 2^(h+1) - 1. Equivalently, if a binary tree spans n total levels (Levels 1..n, so h = n - 1), total maximum nodes equal 2^n - 1 (and at level n when 0-indexed, 2^n).
[HI] 0-आधारित स्तर i (रूट = 0) पर प्रत्येक नोड अधिकतम 2 शाखाएं बनाता है, अतः स्तर i पर अधिकतम 2^i नोड्स हो सकते हैं (यदि रूट को स्तर 1 मानें तो स्तर k पर 2^(k-1))। ऊंचाई h (0 से h तक कुल h+1 स्तर) में कुल अधिकतम नोड्स N_max = 2^(h+1) - 1 होते हैं। इसी प्रकार यदि ट्री में कुल n स्तर (1 से n) हों, तो कुल अधिकतम नोड्स 2^n - 1 होते हैं।
3. Minimum/Maximum Height Bounds and Array Indexing (न्यूनतम व अधिकतम ऊंचाई सीमाएं तथा एरे इंडेक्सिंग)
[EN] For N nodes (edge-based height), packing every level maximally gives minimum possible height h_min = floor(log2(N)), whereas stretching one child per node (a Left-Skewed or Right-Skewed binary tree) yields maximum height h_max = N - 1 (degenerating into a Linked List with O(N) search). Conversely, for edge-height h, minimum nodes = h + 1. Storing a binary tree in a 0-indexed array places Left Child at 2*i + 1, Right Child at 2*i + 2, and Parent at floor((i - 1) / 2).
[HI] N नोड्स वाले बाइनरी ट्री की न्यूनतम ऊंचाई (पूर्ण संतुलित स्थिति में) floor(log2(N)) और अधिकतम ऊंचाई (Skewed श्रृंखला स्थिति में) N - 1 होती है। ऊंचाई h के लिए न्यूनतम नोड्स h + 1 लगते हैं। 0-इंडेक्स्ड एरे निरूपण में इंडेक्स i पर स्थित नोड का बायां बच्चा 2i + 1, दायां बच्चा 2i + 2 और पैरेंट (i - 1) / 2 पर होता है।
4. Universal Leaf-to-Degree-2 Theorem (n0 = n2 + 1) and NULL Pointers (सार्वभौमिक पत्ती प्रमेय (n0 = n2 + 1) और NULL पॉइंटर्स)
[EN] Let n0, n1, and n2 denote counts of binary tree nodes having 0, 1, and 2 children respectively. Total nodes N = n0 + n1 + n2, while total edges E = N - 1 = 0*n0 + 1*n1 + 2*n2. Equating both expressions cancels n1 cleanly and proves n0 = n2 + 1 for EVERY non-empty binary tree! Furthermore, a linked binary tree of N nodes maintains 2N total child pointer fields, of which N - 1 point to children and exactly N + 1 fields remain NULL.
[HI] यदि किसी बाइनरी ट्री में 0, 1 और 2 बच्चों वाले नोड्स क्रमशः n0, n1 और n2 हैं, तो कुल नोड्स N = n0 + n1 + n2 और कुल एजेस N - 1 = n1 + 2*n2 होती हैं। दोनों से n1 कटने पर हर गैर-खाली बाइनरी ट्री के लिए n0 = n2 + 1 सिद्ध होता है। साथ ही, N नोड्स वाले लिंक्ड बाइनरी ट्री के कुल 2N पॉइंटर क्षेत्रों में से हमेशा ठीक N + 1 पॉइंटर्स NULL रहते हैं।
Syntax, Formula & Technical Example (Binary Tree: Definition, Properties and Maximum Nodes Formulas)
// Linked Binary Tree Node + Universal Formulas:
struct BNode { int data; struct BNode *left, *right; };
// 1) Max nodes at level i (root=0): 2^i
// 2) Max nodes in height h (edges): 2^(h+1) - 1 [= 2^n - 1 for n levels]
// 3) Min/Max height for N nodes: floor(log2(N)) <= h <= N - 1
// 4) Leaf vs 2-child nodes: n0 = n2 + 1
// 5) NULL child pointers in N nodes: N + 1
// 6) 0-indexed array children of i: left = 2*i + 1, right = 2*i + 2
Binary Tree: Definition, Properties and Maximum Nodes Formulas Quick Reference & Comparison Table
| Binary Tree Formula | Mathematical Expression | Key Exam Fact |
|---|---|---|
| Max Nodes at Level i (0-based) | 2^i nodes | Root at level 0 gives 2^0 = 1 node |
| Max Total Nodes (Height h) | 2^(h + 1) - 1 nodes (or 2^n - 1 for n levels) | Attained when every level is completely filled |
| Height Bounds for N Nodes | floor(log2(N)) <= h <= N - 1 | Min when balanced; Max when skewed |
| Leaf to Degree-2 Relation | n0 = n2 + 1 | Independent of degree-1 node count n1 |
Binary Tree: Definition, Properties and Maximum Nodes Formulas Top 20 Bilingual MCQs with Answers
Q1. What is the MAXIMUM number of nodes possible at level i (where Root is at level 0) of a Binary Tree?
(बाइनरी ट्री के स्तर i (जहाँ रूट स्तर 0 पर हो) में अधिकतम कितने नोड्स हो सकते हैं?)
(A) 2^i
(B) 2 * i
(C) 2^(i + 1) - 1
(D) 2^(i - 1)
Correct Answer: (A)
[EN] Level 0 has 2^0=1 node, level 1 has 2^1=2 nodes, level 2 has 2^2=4 nodes, and level i has at most 2^i nodes.
[HI] स्तर 0 पर 2^0=1, स्तर 1 पर 2^1=2, स्तर 2 पर 2^2=4 तथा स्तर i पर अधिकतम 2^i नोड्स हो सकते हैं।
Q2. What is the MAXIMUM total number of nodes in a Binary Tree spanning n total levels (Root at level 1 up to level n)?
(कुल n स्तरों (रूट स्तर 1 से स्तर n तक) वाले बाइनरी ट्री में कुल अधिकतम कितने नोड्स हो सकते हैं?)
(A) 2^n - 1
(B) 2^(n + 1) - 1
(C) 2^n
(D) 2^(n - 1)
Correct Answer: (A)
[EN] Summing 2^0 + 2^1 + ... + 2^(n-1) across n levels equals 2^n - 1 (which matches 2^(h+1) - 1 since h = n - 1).
[HI] कुल n स्तरों (0 से n-1) के नोड्स जोड़ने पर 1 + 2 + 4 + ... + 2^(n-1) = 2^n - 1 कुल अधिकतम नोड्स मिलते हैं।
Q3. If a Binary Tree has 14 nodes of degree 2 (two children) and 9 nodes of degree 1 (one child), how many Leaf nodes does it contain?
(यदि किसी बाइनरी ट्री में 2 बच्चों वाले 14 नोड्स और 1 बच्चे वाले 9 नोड्स हैं, तो उसमें कुल कितने Leaf नोड्स होंगे?)
(A) 24
(B) 23
(C) 14
(D) 15
Correct Answer: (D)
[EN] By the universal binary tree theorem n0 = n2 + 1, leaf count depends only on n2: 14 + 1 = 15 (n1 = 9 does not alter n0!).
[HI] प्रमेय n0 = n2 + 1 के अनुसार पत्तियों की संख्या केवल n2 पर निर्भर करती है: 14 + 1 = 15 (n1 का कोई प्रभाव नहीं पड़ता)।
Q4. In a linked representation of a Binary Tree containing N nodes (where each node stores `left` and `right` pointers), how many pointer fields store NULL?
(N नोड्स वाले लिंक्ड बाइनरी ट्री (प्रत्येक नोड में left और right पॉइंटर) में कुल कितने पॉइंटर क्षेत्र NULL होते हैं?)
(A) 2 * N
(B) N
(C) N - 1
(D) N + 1
Correct Answer: (D)
[EN] Out of 2N total child pointers, exactly N - 1 point to the N - 1 non-root nodes, leaving 2N - (N - 1) = N + 1 NULL pointers.
[HI] कुल 2N पॉइंटर्स में से N - 1 पॉइंटर्स बच्चों से जुड़े होते हैं, अतः शेष 2N - (N - 1) = N + 1 पॉइंटर्स NULL रहते हैं।
Q5. For a Binary Tree with N = 100 nodes, what are its MINIMUM and MAXIMUM possible edge-based heights?
(N = 100 नोड्स वाले बाइनरी ट्री की न्यूनतम और अधिकतम संभावित एज-आधारित ऊंचाइयां क्रमशः क्या होंगी?)
(A) Min height = 6, Max height = 100
(B) Min height = 6, Max height = 99
(C) Min height = 5, Max height = 99
(D) Min height = 7, Max height = 100
Correct Answer: (B)
[EN] floor(log2(100)) = 6 (since 2^6=64 <= 100 < 128), and maximum height (skewed chain) is N - 1 = 99.
[HI] न्यूनतम ऊंचाई floor(log2(100)) = 6 और अधिकतम ऊंचाई (skewed अवस्था में) N - 1 = 99 होती है।
Q6. How many structurally distinct UNLABELED Binary Trees can be formed using exactly 3 nodes?
(ठीक 3 बिना-लेबल (Unlabeled) नोड्स का उपयोग करके संरचनात्मक रूप से कितने अलग-अलग बाइनरी ट्री बनाए जा सकते हैं?)
(A) 3
(B) 6
(C) 5 (3rd Catalan Number C_3)
(D) 4
Correct Answer: (C)
[EN] Using Catalan formula C_n = (2n)! / ((n+1)! * n!) for n = 3 gives 6! / (4! * 3!) = 5 distinct binary trees.
[HI] कैटलान संख्या सूत्र C_3 = (2*3)! / (4! * 3!) = 5 भिन्न संरचना वाले बाइनरी ट्री बनते हैं।
Q7. What happens if a Binary Tree of N nodes becomes completely Left-Skewed (every node has at most a left child)?
(यदि N नोड्स वाला बाइनरी ट्री पूरी तरह Left-Skewed हो (हर नोड का केवल बायां बच्चा हो), तो इसका प्रदर्शन कैसा होगा?)
(A) It holds 2^N - 1 nodes
(B) Height becomes floor(log2(N)) and search stays O(log N)
(C) All nodes become leaves
(D) Height becomes N - 1 and search degrades to O(N) like a singly linked list
Correct Answer: (D)
[EN] A skewed binary tree loses branching completely, giving linear height N - 1 and O(N) worst-case lookup.
[HI] Skewed बाइनरी ट्री एक रैखिक सूची जैसा बन जाता है जिसकी ऊंचाई N - 1 और खोज जटिलता O(N) हो जाती है।
Q8. In a 0-indexed array storing a Binary Tree, if a node resides at index 6, where are its Parent and Right Child located?
(0-इंडेक्स्ड एरे निरूपण में यदि कोई नोड इंडेक्स 6 पर है, तो उसके पैरेंट और राइट चाइल्ड के इंडेक्स क्या होंगे?)
(A) Parent at 2, Right Child at 14
(B) Parent at 3, Right Child at 14
(C) Parent at 3, Right Child at 13
(D) Parent at 2, Right Child at 13
Correct Answer: (A)
[EN] Parent = (6 - 1) // 2 = 2; Left Child = 2*6 + 1 = 13; Right Child = 2*6 + 2 = 14.
[HI] Parent = (6 - 1) / 2 = 2 और Right Child = 2*6 + 2 = 14 पर स्थित होगा।
Q9. If a Binary Tree has edge-based height h = 5, what are the MINIMUM and MAXIMUM number of nodes it can possess?
(यदि किसी बाइनरी ट्री की एज-आधारित ऊंचाई h = 5 है, तो उसमें कम से कम और अधिक से अधिक कितने नोड्स हो सकते हैं?)
(A) Min = 6, Max = 32
(B) Min = 5, Max = 63
(C) Min = 6, Max = 63
(D) Min = 5, Max = 31
Correct Answer: (C)
[EN] Min nodes = h + 1 = 6 (skewed); Max nodes = 2^(h + 1) - 1 = 2^6 - 1 = 63.
[HI] न्यूनतम नोड्स h + 1 = 6 तथा अधिकतम नोड्स 2^(5 + 1) - 1 = 63 हो सकते हैं।
Q10. Why are two 2-node binary trees—one where Root has only a Left child, and one where Root has only a Right child—considered DIFFERENT?
(दो नोड्स वाले दो बाइनरी ट्री—एक में रूट का केवल बायां बच्चा और दूसरे में केवल दायां बच्चा—दोनों को अलग क्यों माना जाता है?)
(A) Because they have different edge counts
(B) Because right children cannot be leaves
(C) Because a Binary Tree is an ordered tree where Left and Right positions are strictly distinct
(D) Because general trees ignore roots
Correct Answer: (C)
[EN] Order of child positions defines binary tree identity, unlike unordered general trees.
[HI] बाइनरी ट्री एक क्रमित (Ordered) संरचना है जिसमें Left और Right स्थान अलग-अलग अर्थ रखते हैं।
Q11. In a 1-based level convention (Root = Level 1), what is the maximum number of nodes at Level 5?
(1-आधारित स्तर नियम (रूट = Level 1) में Level 5 पर अधिकतम कितने नोड्स हो सकते हैं?)
(A) 32
(B) 31
(C) 8
(D) 16 (2^(5 - 1))
Correct Answer: (D)
[EN] Under 1-based levels, level k holds at most 2^(k - 1) nodes; for k = 5 that equals 2^4 = 16.
[HI] 1-आधारित स्तर में स्तर k पर अधिकतम 2^(k - 1) नोड्स आते हैं, अतः Level 5 पर 2^4 = 16 नोड्स होंगे।
Q12. Suppose a Binary Tree has 20 total nodes and 7 Leaf nodes (n0 = 7). How many nodes have degree 2 (n2) and degree 1 (n1)?
(यदि 20 नोड्स वाले एक बाइनरी ट्री में 7 पत्तियाँ (n0 = 7) हैं, तो उसमें 2 बच्चों वाले (n2) और 1 बच्चे वाले (n1) नोड्स क्रमशः कितने होंगे?)
(A) n2 = 6 and n1 = 8
(B) n2 = 7 and n1 = 6
(C) n2 = 8 and n1 = 5
(D) n2 = 6 and n1 = 7
Correct Answer: (D)
[EN] From n0 = n2 + 1 -> 7 = n2 + 1 -> n2 = 6. Then n1 = N - n0 - n2 = 20 - 7 - 6 = 7.
[HI] n0 = n2 + 1 से n2 = 7 - 1 = 6 निकलता है, और शेष n1 = 20 - 7 - 6 = 7 होगा।
Q13. What is the total number of binary trees (LABELED with N distinct keys) possible with N = 3 nodes?
(3 अलग-अलग लेबल (अद्वितीय मान) वाले नोड्स से कुल कितने भिन्न बाइनरी ट्री बनाए जा सकते हैं?)
(A) 15
(B) 6
(C) 5
(D) 30 (C_3 * 3! = 5 * 6)
Correct Answer: (D)
[EN] Each of the C_N unlabeled tree shapes can be populated in N! label permutations: 5 * 6 = 30.
[HI] 5 बिना-लेबल संरचनाओं में से प्रत्येक पर 3! = 6 क्रमचय लग सकते हैं, अतः कुल 5 * 6 = 30 ट्री बनेंगे।
Q14. In a Binary Tree, what is the maximum possible Degree of any node?
(बाइनरी ट्री में किसी भी एक नोड की अधिकतम संभावित डिग्री कितनी हो सकती है?)
(A) 2
(B) 3
(C) Unlimited
(D) 1
Correct Answer: (A)
[EN] By definition, every node in a binary tree has 0, 1, or at most 2 children.
[HI] परिभाषा के अनुसार बाइनरी ट्री के किसी भी नोड में 0, 1 या अधिकतम 2 बच्चे ही हो सकते हैं।
Q15. How many edges are present in a completely filled Binary Tree of edge-height h = 4?
(एज-आधारित ऊंचाई h = 4 वाले पूर्ण भरे बाइनरी ट्री में कुल कितनी एजेस होंगी?)
(A) 15
(B) 31
(C) 16
(D) 30
Correct Answer: (D)
[EN] Nodes N = 2^(4+1) - 1 = 31; every tree has E = N - 1 = 31 - 1 = 30 edges.
[HI] कुल नोड्स N = 2^(4+1) - 1 = 31 होंगे, और कुल एजेस E = N - 1 = 30 होंगी।
Q16. Which statement is NOT true about Binary Trees?
(बाइनरी ट्री के बारे में इनमें से कौन सा कथन असत्य (NOT true) है?)
(A) At 0-based level i, at most 2^i nodes can exist
(B) An empty structure with 0 nodes is a valid Binary Tree
(C) The number of leaf nodes always exceeds the number of degree-2 nodes by 1
(D) A Binary Tree must always have at least 1 node and every node must have exactly 2 children
Correct Answer: (D)
[EN] A general Binary Tree allows 0, 1, or 2 children (and even an empty 0-node tree); requiring strictly 0 or 2 children defines a Strict/Full Binary Tree.
[HI] सामान्य बाइनरी ट्री में 0, 1 या 2 बच्चे हो सकते हैं और खाली ट्री भी वैध है; केवल 0 या 2 बच्चों की शर्त Strict/Full बाइनरी ट्री में होती है।
Q17. Within Binary Tree: Definition, Properties and Maximum Nodes Formulas, which binary tree formula directly maps to: "2^i nodes"?
(Binary Tree: Definition, Properties and Maximum Nodes Formulas में कौन सा Binary Tree Formula सीधे "2^i nodes" से संबंधित है?)
(A) Height Bounds for N Nodes
(B) Leaf to Degree-2 Relation
(C) Max Nodes at Level i (0-based)
(D) Max Total Nodes (Height h)
Correct Answer: (C)
[EN] In Binary Tree: Definition, Properties and Maximum Nodes Formulas, 'Max Nodes at Level i (0-based)' handles '2^i nodes' (Root at level 0 gives 2^0 = 1 node).
[HI] Binary Tree: Definition, Properties and Maximum Nodes Formulas में 'Max Nodes at Level i (0-based)' का कार्य/विवरण '2^i nodes' (Root at level 0 gives 2^0 = 1 node) है।
Q18. Which option accurately describes 'Max Total Nodes (Height h)' in Binary Tree: Definition, Properties and Maximum Nodes Formulas?
(Binary Tree: Definition, Properties and Maximum Nodes Formulas के संदर्भ में 'Max Total Nodes (Height h)' की सही विशेषता कौन सी है?)
(A) 2^(h + 1) - 1 nodes (or 2^n - 1 for n levels)
(B) n0 = n2 + 1
(C) floor(log2(N)) <= h <= N - 1
(D) 2^i nodes
Correct Answer: (A)
[EN] 'Max Total Nodes (Height h)' provides '2^(h + 1) - 1 nodes (or 2^n - 1 for n levels)' — key point: Attained when every level is completely filled.
[HI] 'Max Total Nodes (Height h)' का मुख्य विवरण '2^(h + 1) - 1 nodes (or 2^n - 1 for n levels)' है (Attained when every level is completely filled)।
Q19. In Binary Tree: Definition, Properties and Maximum Nodes Formulas, identify the correct parameter for the specification: "floor(log2(N)) <= h <= N - 1".
(Binary Tree: Definition, Properties and Maximum Nodes Formulas में "floor(log2(N)) <= h <= N - 1" विवरण किस विकल्प के लिए सही है?)
(A) Max Total Nodes (Height h)
(B) Max Nodes at Level i (0-based)
(C) Height Bounds for N Nodes
(D) Leaf to Degree-2 Relation
Correct Answer: (C)
[EN] 'Height Bounds for N Nodes' corresponds to 'floor(log2(N)) <= h <= N - 1' (Min when balanced; Max when skewed).
[HI] 'Height Bounds for N Nodes' का संबंध 'floor(log2(N)) <= h <= N - 1' (Min when balanced; Max when skewed) से है।
Q20. Considering Binary Tree: Definition, Properties and Maximum Nodes Formulas, what key behavior defines 'Leaf to Degree-2 Relation'?
(Binary Tree: Definition, Properties and Maximum Nodes Formulas में 'Leaf to Degree-2 Relation' की मुख्य भूमिका या मान क्या है?)
(A) n0 = n2 + 1
(B) 2^(h + 1) - 1 nodes (or 2^n - 1 for n levels)
(C) floor(log2(N)) <= h <= N - 1
(D) 2^i nodes
Correct Answer: (A)
[EN] 'Leaf to Degree-2 Relation' represents 'n0 = n2 + 1' (Independent of degree-1 node count n1).
[HI] 'Leaf to Degree-2 Relation' का अर्थ/मान 'n0 = n2 + 1' है (Independent of degree-1 node count n1)।
Binary Tree: Definition, Properties and Maximum Nodes Formulas — Exam FAQs
Q1: Why is the maximum nodes formula sometimes written as 2^n, sometimes 2^n - 1, and sometimes 2^(h+1) - 1?
अधिकतम नोड्स का सूत्र कहीं 2^n, कहीं 2^n - 1 और कहीं 2^(h+1) - 1 क्यों लिखा जाता है?
[EN] Always check what the formula measures: (1) Max nodes AT a single 0-based level n is 2^n (or 2^(n-1) if 1-based). (2) Max TOTAL nodes across n levels (1..n) is 2^n - 1. (3) Because n levels correspond to edge-height h = n - 1, that same total formula written in terms of h is 2^(h+1) - 1.
[HI] यह देखना आवश्यक है कि प्रश्न क्या पूछ रहा है: (1) केवल 0-आधारित एक स्तर n पर अधिकतम नोड्स = 2^n, (2) कुल n स्तरों में सभी नोड्स का योग = 2^n - 1, और (3) एज-आधारित ऊंचाई h के रूप में कुल नोड्स = 2^(h+1) - 1।
Q2: What does Threaded Binary Tree optimize compared to a standard linked Binary Tree?
सामान्य लिंक्ड बाइनरी ट्री की तुलना में Threaded Binary Tree क्या सुधार करता है?
[EN] A standard N-node linked binary tree wastes N + 1 NULL pointer fields; a Threaded Binary Tree repurposes those NULL pointers to point to inorder predecessors/successors, enabling fast stack-free traversal.
[HI] सामान्य N-नोड ट्री में N + 1 पॉइंटर्स NULL बेकार पड़े रहते हैं; Threaded बाइनरी ट्री उन्हीं खाली पॉइंटर्स का उपयोग करके बिना स्टैक/रिकर्शन के तेज ट्रैवर्सल संभव बनाता है।
Q3: Is a Binary Search Tree (BST) the same as a Binary Tree?
क्या Binary Search Tree (BST) और Binary Tree एक ही होते हैं?
[EN] No. Every BST is a Binary Tree (<= 2 children), but a BST adds a strict ordering invariant (left subtree keys < node key < right subtree keys), whereas a general Binary Tree imposes no key-ordering constraint.
[HI] नहीं। हर BST एक बाइनरी ट्री होता है, पर BST में कुंजियों के क्रम का विशेष नियम (बायां < रूट < दायां) जुड़ जाता है, जो सामान्य बाइनरी ट्री में नहीं होता।
Post a Comment
Post a Comment