Essay Example on Binary Search Tree Implementation BST

Subcategory:

Category:

Words:

465

Pages:

2

Views:

193
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


Search It is the process of searching an element Join Two or more trees are joined in a single tree Insertion Process of inserting an element Deletion Process of deleting an element Rotations Splaying in splay tree is done with tree rotations There are six different rotations as following 1 Zig Rotation 2 Zag Rotation 3 Zig Zig Rotation 4 Zag Zag Rotation 5 Zig Zag Rotation 6 Zag Zig Rotation Our project will be aimed at how the following operations will be performed and what the time complexity of the above mentioned operations will be However our project will also be aimed at finding new or better methods with a better time complexity for the operations Technology Used We will use C programming language to implement splay tree Software Requirements o C Hardware Requirements o No as such hardware is required Though PC or laptop equipped with minimum requirement to run C is needed Technical Terms 1 Splaying It is the process in which a node is brought into the root position by one or more than one rotations 2 Rotation The process of moving nodes one by one from one point to the other is called rotation Zig Rotation It is right rotation of nodes i e every node is moved one position to the right of its current position Zag Rotation It is left rotation of nodes i e every node is moved one position to the left of its current position Zig Zig Rotation

It is double right rotation of nodes i e every node is moved two positions to the right of its current position Zag Zag Rotation It is double left rotation of nodes i e every node is moved two positions to the left of its current position Zig Zag Rotation Zigs followed by Zags is called Zig Zag rotation i e for every zig right shift there is a zag left shift Zag Zig Rotation Zags followed by Zigs is called Zag Zig rotation i e for every zag left shift there is a zig right shift Feasibility Study This project is on Splay trees which is an obscure binary search tree meaning it is not used as frequently as most of the other binary search trees like AVL trees simple binary search tress etc This project is to use Splay tress and thus provide with implementations at which this can be used and thus outperform other widely used trees in some of the defined areas This tree is useful 1 To access frequently accessed items as they are easy to find because Splay trees have excellent locality properties 2 They are simpler as they don t have any extra field like other binary search trees 3 



They can change with read only operations like search also Need of Splay Trees 1 Splay trees have excellent locality properties 2 They are the fastest types of BST s for many applications Significance of Splay Trees They are the more efficient than other type of BSTs because of their excellent locality properties Splay tress achieve this by exploiting temporal locality i e the recently accessed items will be at the top of the tree Splay trees can perform at its best in the following implementations With network routers in which IP addresses of the recently used might be used again or maybe many times in the future thus it will be at a height above the others They are already being used in Windows NT in the system codes networking virtual memory etc They are used in the GCC complier They are used in the GNU C library They can be used in implementing caches They can be used in garbage collectors BIBLIOGRAPHY http www cs cornell edu courses cs312 2008sp lectures lec25 html https people eecs berkeley edu jrs 61b lec 36 http btechsmartclass com DS U5_T5 html www youtube com www wikipedia com



Write and Proofread Your Essay
With Noplag Writing Assistance App

Plagiarism Checker

Spell Checker

Virtual Writing Assistant

Grammar Checker

Citation Assistance

Smart Online Editor

Start Writing Now

Start Writing like a PRO

Start