Trees

Description

Mind Map on Trees, created by Angelica Cordero on 11/06/2022.
Angelica Cordero
Mind Map by Angelica Cordero, updated more than 1 year ago
Angelica Cordero
Created by Angelica Cordero over 2 years ago
1
0

Resource summary

Trees
  1. General Trees
    1. Terminology: parent, child, ancestor, descendant
      1. Tree: With the exception of the top element, each element in a tree has a parent element and zero or more children elements
        1. Top element = root
          1. Set of nodes storing elements
          2. Edge: pair of nodes (u,v): u is the parent of v
            1. Path: sequence of nodes
            2. Tree ADT
              1. getElement() root() parent(p) children(p) numChildren(p)
            3. Binary Trees
              1. Ordered tree
                1. Every node has at most two children
                  1. Each child is labeled as being either left child or right child
                    1. A left child precedes a right child in the order of children of a node
                    2. Binary Tree ADT
                      1. left(p) right(p) sibling(p)
                    3. Implementing Trees
                      1. Linked Structure
                        1. addRoot(e) addLeft(p,e) addRight(p,e) set(p,e) remove (p)
                        2. Tree Traversal Algorithms
                          1. Traversal: systematic way of accessing all the positions of the tree
                            1. Preorder traversal: the root of T is visited first and then the subtrees rooted at its children are traversed recursively
                              1. Postorden traversal: it recursively traverses the subtrees rooted at the children of the root first, an then visits the root
                                1. Inorder traversal: visiting the nodes of T from left to right
                              Show full summary Hide full summary

                              Similar

                              Evergreen Trees
                              CAROLINA PR
                              The Norman Conquest 1066-1087
                              adam.melling
                              GCSE REVISION TIMETABLE
                              haameem1999
                              Maths
                              xcathyx99
                              GCSE History – The early years and the Weimar Republic 1918-1923
                              Ben C
                              Chemistry Rates of Reaction Revision
                              11mzroser
                              MAPA MENTAL
                              blanca beatriz m
                              L'environnement
                              Bryony Whitehead
                              Carbohydrates
                              kevinlinkovoor
                              Two years and no baby
                              Zahra Habeeb