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
                              An Inspector calls Themes
                              anya14
                              French -> small but important words for GCSE
                              georgie_hill
                              Of Mice and Men
                              amyk4321
                              AQA - English Language Unit 1
                              Alice Love
                              GCSE French - The Environment
                              Abby B
                              A View from the Bridge
                              Mrs Peacock
                              Physics 2
                              Peter Hoskins
                              HEMORRAGIAS - OBST PATOLOGICA
                              María José Alvarez Gazzano
                              SFDC App Builder 1 (176-200ish)
                              Connie Woolard