डेटा स्ट्रक्चर में Tree क्या है और इसके types क्या है?

Hello दोस्तों! आज हम इस पोस्ट में Tree in Data Structure in Hindi (डेटा स्ट्रक्चर में ट्री क्या है?) के बारें में पढेंगे और इसके Types को जानेंगे. आप इसे पूरा पढ़िए, आपको यह आसानी से समझ में आ जायेगा. तो चलिए शुरू करते हैं:-

Tree in Data Structure in Hindi

  • Tree एक hierarchical data structure होता है जो कि information या data को hierarchical (श्रेणीबद्ध) तरीके से स्टोर करता है.

  • “ट्री(tree), nodes का एक समूह होता है जिनमें सामान्यतया hierarchical relationship होती है।”

  • Tree एक non-linear डेटा स्ट्रक्चर होता है।

  • Tree में parent-child relationship होती है।

  • Tree के प्रत्येक data item को हम node कहते है।

  • Tree में जो सबसे ऊपर वाला node होता है उसे हम root node कहते है।

  • एक node का अधिकतम एक ही parent हो सकता है। लेकिन केवल root node का कोई parent नही होता है।

  • एक tree में प्रत्येक node का शून्य या ज्यादा child nodes हो सकते है।

  • ऐसे nodes जिनके एक भी child nodes नही होते है उन्हें leaf node या terminal node कहते है।

  • वैसे तो tree हमेशा ऊपर की ओर बढ़ता है लेकिन data structure का tree हमेशा नीचे की ओर बढ़ता है।

Tree Terminology in Hindi

नीचे आपको tree का चित्र दिया गया है. जिसमें इसके कुछ महत्वपूर्ण terms दिए गये हैं:-

TermsDescription
Rootएक Tree में root node सबसे ऊपर का node होता है. दूसरे शब्दों में कहें तो, root node का कोई भी parent नहीं होता है.
ऊपर दिए गये चित्र में A एक root node है.
Parent nodeयदि कोई node किसी sub-node को contain करता है तो इस node को sub-node का parent कहा जाता है.
दूसरे शब्दों में कहें तो, “एक node का ठीक पिछला वाला node, parent node होता है.”
चित्र में, B जो है वह D, E, F का parent है.
Child nodeयदि एक नोड किसी नोड का वंशज (descendant) है, तो इस नोड को child node के रूप में जाना जाता है।
ऊपर दिए गये चित्र में, D, E, F जो हैं वे B के child हैं.
Siblingवे nodes जिनका एक ही parent होता है उन्हें siblings कहते हैं. चित्र में, B और C siblings हैं.
Leaf nodeवह नोड जिसका कोई भी child नहीं होता है उसे leaf node कहते हैं. चित्र में, D, H, F, G leaf nodes हैं.
Tree में, एक leaf node सबसे नीचे वाला नोड होता है. एक tree में कितने भी leaf nodes हो सकते है. Leaf nodes को external nodes भी कहते हैं.
Edgeएक edge दो nodes के मध्य का connection होता है. यह दो nodes के बीच की line होती है.
चित्र में, A और B के बीच की line एक edge है.
Internal nodeवह नोड जिसका कम से कम एक child node होता है उसे internal node कहते हैं.

Advantages of Tree in Data Structure in Hindi

Data Structure में, Tree के निम्नलिखित फायदे होते हैं:-

  1. Tree का सबसे बड़ा फायदा यह है कि इसके द्वारा हम data को hierarchical (श्रेणीबद्ध) तरीके से स्टोर कर सकते हैं. जैसे कि – folder structure, XML/HTML data आदि.
  2. इसके द्वारा हम आसानी से searching और traversing कर सकते हैं.
  3. Tree बहुत ही flexible होता है अर्थात् इसमें हम किसी भी sub-tree को आसानी से move कर सकते हैं.
  4. इसके द्वारा हम data को तेजी से search, insert और delete कर सकते है.

Types of Tree in Data Structure in Hindi

Data structure में, Tree के निम्नलिखित प्रकार होते हैं:-

  1. General Tree – वह tree जिसमें एक node के पास या तो zero (शून्य) child node हो सकते हैं या फिर बहुत सारें child nodes हो सकते हैं. इस प्रकार के tree को general tree कहते हैं.

    इसमें child nodes पर कोई भी restriction (रोक) नहीं होती है. इस tree के सबसे ऊपर वाले node को root node कहा जाता है और इसके बहुत सारें sub-trees हो सकती हैं.

  2. Binary Tree – Binary का मतलब होता है दो संख्या:- 0 और 1. Binary tree एक tree होती है जिसमें प्रत्येक node के पास अधिकतम दो ही child nodes हो सकते हैं.

    इसमें child nodes पर restriction होता है. क्योंकि binary tree में प्रत्येक node के पास केवल दो ही child nodes हो सकते हैं.

    Binary tree में, सबसे ऊपर वाले नोड को root node कहा जाता है और इसके केवल दो ही sub-trees होती हैं:- right subtree और left subtree.
    इसे पूरा पढने के लिए click करें:- बाइनरी ट्री क्या है?

  3. Binary Search Tree – बाइनरी सर्च ट्री एक non-linear data structure है जिसमें एक node बहुत सारें nodes के साथ जुडा रहता है. यह एक node पर आधारित binary tree है.
    इसे पूरा पढ़ें:- बाइनरी सर्च ट्री क्या है?

  4. AVL tree – यह एक प्रकार की बाइनरी ट्री है. इसे self balancing binary search tree भी कहा जाता है. इसके पास एक extra जानकारी होती है जिसे balance factor कहते हैं.
    इसे पूरा पढ़ें:- AVL Tree क्या है?

  5. B-tree – B-tree एक M-Way(multi-way) tree होता है जो कि विशेषकर disk में प्रयोग करने के लिए बनाया जाता है। B-tree को balanced tree कहा जाता है।
    इसे पूरा पढ़ें:;- B tree क्या है?

Application of Tree in Hindi – ट्री के अनुप्रयोग

इसका प्रयोग बहुत सारें कार्यों के लिए किया जाता है. कुछ के बारें में नीचे दिया जा रहा है:-

  1. Tree एक non-linear डेटा स्ट्रक्चर है इसलिए इसका प्रयोग data को non-linear तरीके से store करने के लिए किया जाता है.
  2. इसका प्रयोग data को प्रभावी रूप से organize (व्यवस्थित) करने के लिए किया जाता है.
  3. बाइनरी सर्च ट्री का प्रयोग तेजी से data को search, insert, delete करने के लिए किया जाता है.
  4. Heap एक ट्री है जिसका प्रयोग priority queues को implement करने के लिए किया जाता है.
  5. B-tree का प्रयोग database में indexing को implement करने के लिए किया जाता है.
  6. इसका प्रयोग artificial intelligence में किया जाता है.
  7. Games को बनाने में इसका इस्तेमाल किया जाता है.
  8. Syntax tree का प्रयोग compilers में किया जाता है.

निवेदन:- अगर आपके लिए यह आर्टिकल उपयोगी रहा हो तो इसे अपने friends और classmates के साथ अवश्य share कीजिये. और आपके data structure या किसी अन्य subject से सम्बन्धित कोई सवाल हो तो उसे नीचे comment के माध्यम से बताइए. Thanks.

22 thoughts on “डेटा स्ट्रक्चर में Tree क्या है और इसके types क्या है?”

  1. सर इस वेबसाइट से मुझे बहुत बढ़िया नोट्स मिले है इसके लिए आपको vry vry thanks

    Reply
  2. This website is very very useful for all students .presonly it is useful for me because i could understand each and everything about tree whiout the help of teacher.
    so thanks a lot who devloped this site.

    Reply
  3. Sir your all topic is very useful for us please tell me what is priority queue
    And what is abstract data type with example of both question please post the answer as soon as possible
    Please sir

    Reply
  4. The website here provides great ease in understanding things.I have been using this website for last 2 -3 years.I think no other website provides simplicity like this website.Thank you background developer.

    Reply

Leave a Comment