Hello Everyone!!! 1
Tree And Graphs 2
Features of Trees Tree Nodes Each node have 0 or more children A node have must one parent Binary tree Tree with 0 to 2 children per node 3 Trees
Binary Search Trees Key property Value at node Smaller values in left subtree Larger values in right subtree 4
Types of Binary Trees Degenerate – only one child Complete – always two children Balanced – mostly two children 5
Binary Search Tree – Insertion Algorithm If X Y, insert new leaf X as new right subtree for Y 6 Binary Search Tree – Deletion Leaf Internal Node
Preorder Traversal Post order Traversal In-order Traversal 7 Binary Tree Traversal Types
Graphs 8 Directed graphs Undirected graphs.
About graphs Vertex or Node(V) Edge or arc (E) Source (u) Sink (v) 9
Depth-First Search (DFS) Breadth-First Search (BFS) 10
Thank You! 11