Essay Examples on Trocaire College

Binary Search Tree Implementation BST

This project is about Binary Search Tree Implementation BST is same as binary tree with the difference that all of its nodes are sorted That's why it is called sorted or ordered binary tree Due to the advantage of sorting operations like minimum maximum searching can be done fast Binary search tree can be implemented in many ways with different concepts Some of the implementations are as follows Splay Tree AVL Tree Red Black Tree 2 3 Tree AA Tree We are picking up Splay Tree for our project It is very popular and well known binary search tree in industry It has very practical implementation because it is self adjusting tree It has one more peculiar property that recently accessed elements can be accessed very quickly Splay tree performs better than rest of BST as it is good in non random operation of many sequences Its worst and average case algorithm is summarised below Algorithm Worst Case Average Case Space O n O n Search Amortized O log n O log n Insert Amortized O log n O log n Delete Amortized O log n O log n All general operations of BST are combined with only one basic operation known as splaying Operations Following operations can be performed on a splay tree Splaying With suitable rotation an element is brought to the root position Split Tree is splitted in two or more trees


2 pages | 465 words
Save