
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































General / Binary Tree
Binary Search – (Search 13)
BINARY TREE
Binary Search Tree
Why?
Examples
Examples
Examples
BST Complexity
BST Implementation – Node
BST Implementation - Class class BST { public : BSTNode* root; BST(): root(NULL) {} //destroy routines ~BST(); void clear(BSTNode* ptr); //insertion routines void insert( int A); void insert_node( int B, BSTNode* &node1); //traversal routines void visit(BSTNode* node) { cout<<" :: "<<node->key<<" :: "<<endl; } void breadth_first(); void depth_first(); void preorder(BSTNode* node); void inorder(BSTNode* node); //searching routines int search( int A); BSTNode* search_node(BSTNode* node, int B); //deletion routines void deletenode( int A); void deletebycopying(BSTNode* &node2); };
BST Operations - Insertion
BST Operations - Searching