• الصفحة الرئيسية
  • إتصل بنا
  • سياسة الخصوصية
Logo
  • الرئيسية
  • أفكار
  • صحة
  • معلومات
  • عجائب وغرائب
  • تكنولوجيا
الصفحة الرئيسية Data Structure IT Tutorials Definition of Tree

Definition of Tree

الكاتب ahmed في 9:49 PM Data Structure IT Tutorials

A tree is a combination of a finite set of elements, called nodes and a finite set of directed lines, called branches that connect the nodes.

The number of branches associated with a node is the degree of the node. When the branch is directed towards the node, it is an indegree branch. When the branch is directed away from the node, it is an out degree branch, the sum of outdegree and indegree branches equal to the degree of the node.

Some important terms:

Definition of Tree
    Definition of Tree
  • Root node: If the tree is non empty, then the first node is called as root. The indegree of root by definition is zero.
  • Leaf node: A node with no successors (nodes after it). There will usually be many leaves in a tree.
  • Non Leaf node: A node which has both a parent and at least one child.
  • Internal nodes: Nodes that are not root and not leaf are called as internal nodes
  • Parent node: A node is a parent if it has successor nodes; means out degree greater than zero.
  • Child node: A node is child node if indegree is one.
  • Siblings: Two or more nodes with same parent are siblings.
  • Ancestor node: An ancestor is any node in the path from the root to the node.
  • Descendant node: A descendent is any node on the path below the parent node.
  • Subtree: A subtree is any connected structure below the root.
  • Directed tree: A directed tree is an acyclic digraph, which has only one node with indegree 0, and others nodes have indegree 1.
  • Binary tree: A binary tree is a tree in which no node can have more than two subtrees. In other word it is a directed tree in which outdegree of each node is less than or equal to two. (i.e. zero, one or two). An empty tree is also a binary tree.
  • Strictly binary tree: If the outdegree of every node in a tree is either 0 or 2, then the tree is said to be strictly binary tree. i.e. each node can have maximum two children or empty left and empty right child.
  • Complete binary tree: A strictly binary tree in which the number of nodes at any level i is 2 i-1 then the tree is said to be complete binary tree.
  • Almost binary tree: A tree of depth d is an almost complete binary tree, if the tree is complete up to the level d-1.
  • Tree traversals: Tree traversal is the technique in which each node in the tree is processed or visited exactly once systematically one after the other. The different tree traversal techniques are Inorder, Preorder and Postorder.Algorithm for tree traversal
     i) Inorder (Left-Root-Right)
  • Traverse the left sub tree in inorder [L]
  • Process the root node [N]
  •  Traverse the right sub tree in inorder [R]
     ii) Preorder (Root-Left-Right)
  • Process the root node [N]
  • Traverse the left sub tree in preorder [L]
  • Traverse the right sub tree in Preorder [R]
     iii) Postorder (Left-Right-Root)
  • Traverse the left subtree in post order. [L]
  • Traverse the Right sub tree in postorder [R]
  • Process the root node [N]
Binary Search tree: A binary search tree is a binary tree in which for each node say x in the tree elements in the left subtree are less than info(x) and elements in the left subtree are greater or equal to info(x).

The operations performed on binary search tree are:

  •  Insertion: An item is inserted
  •  Searching: Search for a specific item in the tree.
  •  Deletion: Deleting a node from a given tree.

    Balanced Search trees: Balanced search tree is on that exhibits a good ratio of breadth to depth. There are special classes of Balanced Search Trees that are self-balancing. That is as new nodes are added or existing nodes are deleted, these Balanced search Trees automatically adjust their topology to maintain an optimal balance. With an ideal balance, the running time for inserts, searches, and deletes even in the worst case is log2n.
    AVL trees, Red-Black trees, Lemma are the examples of balanced search trees.


    AVL Trees: An AVL tree is a binary search tree whose left subtree and right subtree differ in height by at most 1 unit, and whose left and right trees are also AVL trees.
    To maintain balance in a height balanced binary tree, each node will have to keep an additional piece of information that is needed to efficiently maintain balance in the tree after every insert and delete operation has been performed. For an AVL tree, this additional piece of information is called the balance factor and it indicates if the difference in height between the left and right subtrees is the same or, if not, which of the two subtrees has height one unit larger. If a node has a balance factor rh(right high). It indicates that the height of the left subtree. Similarly the balance factor for a node could be lh(left height) or eh(equal height).



    Binary Heap tree: A binary heap is a complete binary tree. A tree that is completely filled except possibly at the bottom level, which is filled from left to right with no missing nodes.

    You Might also view the following Related Posts

    • Fundamental of data structures
    • Definition of Stack
    • Definition of Queues
    • Definition of List and Linked List
    • Graph Definition

    For more other Posts: Click Here

    شارك المقال :
    Tweet
    ✚

    مقالات ذات صلة

    التالي
    المشاركةالتالية
    السابق
    المشاركة السابقة

    تحويل كودإخفاء محول الأكواد الإبتساماتإخفاء

    شكرا لمشاركتنا رأيك
    Subscribe to: Post Comments (Atom)
    • Facebook
    • twitter
    • googleplus
    • youtube
    • linkedin

    الأكثر زيارة

    • What is Information ?
      Information  can be defined as data that has been processed into a form that is meaningful to the recipient and is of real or perceived valu...
    • What is Information Technology?
      Definitions of  Information technology  ( IT ) It is a branch of engineering dealing with the use of computers and telecommunications equipm...
    • بالصور الفائزة بمسابقة ملكة جمال مصر 2017
      بالصور الفائزة بمسابقة ملكة جمال مصر 2017
      بالصور الفائزة بمسابقة ملكة جمال مصر 2017 لن تصدق من هي فرح صدقي ↓↓  لمشاهدة الصور والخبر كامل اضغط هنا  ↓↓ رابط المو...
    • Interview Questions on Stack and Queue in Data Structure set-2
      1) The queue in which the insertion takes place in the first position after of last element is a ...... A. priority B. dequeue C. circular D...
    • List of Top 65 Search Engine Submission Add URLs.
      List of Top 65 Search Engine Submission Add URLs.
      To get your site on the top ranking on the search engine results, Your site or URL must be indexed by Search Engines. For that you have to s...
    • List of Best Keyword Research Tools for Better SEO
      List of Best Keyword Research Tools for Better SEO
      Everyone needs to do keyword research work for the site before starting search engine optimization work as the first and most essential tas...
    • What are the different types of scheduling methods?
      Process scheduling is one way for a processor to handle n processes , by scheduling the execution process. Each process is executed one by ...
    • Solved MCQ on Database Backup and Recovery in DBMS set-1
      1) Which of the following is not a recovery technique? A. Deferred update B. Immediate update C. Two-phase commit D. Recovery management 2)C...
    • Solved MCQ on Distributed Database Transaction Management set-4
      1) Commit and rollback are related to .......... A. data integrity B. data consistency C. data sharing D. data security 2) The transaction w...
    • Solved MCQ on Fundamental of DBMS set-10
      1) Which of the following is not a characteristic of a relational database model? A. Table B. Tree like structure C. Complex logical relatio...

    الأقسام

    • Artificial Intelligence(AI)
    • Backlinking
    • Basic IT
    • Best List
    • Blogging Tips
    • C
    • C#
    • C++
    • Computer Architecture
    • Computer Fundamental
    • Computer Security
    • Computer/IT Officer Exam
    • CSS
    • Data Mining and Warehousing
    • Data Recovery Tools
    • Data Structure
    • Database Management System
    • E-commerce
    • E-government
    • Internet & Web Designing
    • IT Law
    • IT Tips and Tricks
    • IT Tutorials
    • Java
    • JavaScript
    • Keyword Research Tools
    • MIS
    • Multiple Choice Question (MCQ)
    • Networking
    • Online Earning
    • Online IT Jobs
    • Operating System
    • Oracle Forms and Reports
    • Programming Guide
    • Programming Language
    • SEO
    • Social Networking Sites
    • Software Download
    • Software Engineering
    • System Analysis and Design
    • Top List
    • VB.Net
    • صحة
    • عجائب وغرائب

    الأرشيف

    • ►  2017 (4)
      • ►  November (3)
      • ►  October (1)
    • ►  2016 (5)
      • ►  April (5)
    • ►  2015 (87)
      • ►  August (1)
      • ►  July (8)
      • ►  June (13)
      • ►  May (2)
      • ►  April (2)
      • ►  March (4)
      • ►  February (20)
      • ►  January (37)
    • ►  2014 (77)
      • ►  December (31)
      • ►  November (4)
      • ►  September (4)
      • ►  August (11)
      • ►  July (8)
      • ►  June (2)
      • ►  May (2)
      • ►  April (2)
      • ►  March (2)
      • ►  February (7)
      • ►  January (4)
    • ►  2013 (132)
      • ►  December (11)
      • ►  November (6)
      • ►  October (4)
      • ►  September (6)
      • ►  August (16)
      • ►  July (9)
      • ►  June (9)
      • ►  May (12)
      • ►  April (13)
      • ►  March (23)
      • ►  February (6)
      • ►  January (17)
    • ▼  2012 (59)
      • ►  December (15)
      • ▼  November (20)
        • Secure Socket Layer (SSL)
        • Internet Security & IP Security (IPSec)
        • Solved MCQ of System Analysis and Design Set-3
        • Solved MCQ of System Analysis and Design Set-2
        • Solved MCQ of System Analysis and Design Set-1
        • Data model and Relational Database Model
        • Database Management System (DBMS)
        • E-commerce Security Issues
        • Risk of e-commerce
        • Benefits of e-commerce
        • Development of e-commerce
        • Graph Definition
        • Definition of Tree
        • Definition of Queues
        • Definition of Stack
        • Fundamental of data structures
        • Programming Language Definition
        • Network Reference Models (Network Architectures)
        • Network Functions
        • Network Topology
      • ►  October (21)
      • ►  September (3)

    إنضم لنا

    © 2017 أفكار جميع الحقوق محفوظة