# Joseph Lindo Trees Sir Joseph Lindo University of the Cordilleras.

## Presentation on theme: "Joseph Lindo Trees Sir Joseph Lindo University of the Cordilleras."— Presentation transcript:

Joseph Lindo Trees Sir Joseph Lindo University of the Cordilleras

Joseph Lindo BST Cases Traversals Binary Tree Trees Course Title Tree In computer science, a tree is an abstract model of a hierarchical structure Trees

Joseph Lindo BST Cases Traversals Binary Tree Trees Course Title Binary Tree A binary tree is a finite set of elements that is either empty or is partitioned into three disjoint subsets. The other two subsets are themselves binary trees called the left and right subtrees. Binary Trees

Joseph Lindo BST Cases Traversals Binary Tree Trees Course Title Binary Tree The other two subsets are themselves binary trees called the left and right subtrees. Ordered Tree Full binary tree Skewed binary tree Binary Trees

Joseph Lindo BST Cases Traversals Binary Tree Trees Course Title Binary Search Tree All identifiers in the left subtree are less than the identifier in the root node All identifiers in the right subtree are greater than the identifier in the root node BST

Joseph Lindo BST Cases Traversals Binary Tree Trees Course Title Traversing It is the process of visiting each node in a tree exactly one. Common traversals: Traversals

Joseph Lindo BST Cases Traversals Binary Tree Trees Course Title Traversals Preorder Node - Left - Right Inorder Left - Node -Right Postorder Left - Right - Node Level - order Traversals Want an easy way to do INORDER Traversal? SQUISHING

Joseph Lindo Trees -- end -- Sir Joseph Lindo University of the Cordilleras

Joseph Lindo Trees -- end na -- Sir Joseph Lindo University of the Cordilleras

Joseph Lindo Applications Tree  Organization charts  File systems  Programming environments

Joseph Lindo Terminologies Tree  Node  Root Node  Parent Node  Siblings  Internal Node  External Node/Leaf/ Terminal

Joseph Lindo Terminologies Tree  Ancestors  Descendants  Subtree  Level  Depth  Height  Degree  Weigth

Joseph Lindo Properties Binary Tree 2 i-1 : maximum number of nodes on level I of a binary tree 2 k -1: maximum number of nodes in a binary tree of height k

Joseph Lindo Examples Traversals

Joseph Lindo Squishing INORDER Traversal

Joseph Lindo Level - Order Traversal

Joseph Lindo Trees -- end -- Sir Joseph Lindo University of the Cordilleras

Joseph Lindo Trees -- end na -- Sir Joseph Lindo University of the Cordilleras

Joseph Lindo Examples

Download ppt "Joseph Lindo Trees Sir Joseph Lindo University of the Cordilleras."

Similar presentations