Data Structures Case Study 1 (1)
Data Structures Case Study 1 (1)
Submitted By:-
KRITIKA DAS
(2101020068)
Binary tree
Binary Search Tree
AVL Tree
B-Tree
Red-Black Tree
2
BINARY TREE-
The binary tree is a type of tree data structure where every parent node has a
maximum of two child nodes. As the name suggests, binary means two, therefore,
each node can have 0, 1, or 2 nodes.
3
BINARY SEARCH TREE
These tree structures are non-linear and one node is connected to a number of
nodes. The node can be connected to at most two child nodes. It is called a
binary search tree because:
4
AVL TREE-
The AVL trees are the types or variants of a binary tree. It consists of properties from
both the binary as well as a binary search tree. Invented by Adelson Velsky Lindas,
these trees are self-balancing which means the
height of the left subtree and the right subtree is balanced. This balance is measured
in terms of a balancing factor.
5
B-TREE-
B Tree is a more generalized form of a binary search tree. It is also known as the
height-balanced m way tree, where m is the order of the tree. Each node of the tree can
have more than one key and more than two child nodes. In the case of a binary tree,
the leaf nodes might not be at the same level. However, in the case of a B Tree, all the
leaf nodes should be at the same level.
APPLICATIONS OF B-TREE-
Dictionary application.
Autocomplete feature in searching.
Auto-completing the text and spells checking.
6
RED- BLACK TREE-
A red-black tree is a kind of self-balancing binary search tree where each node has an
extra bit, and that bit is often interpreted as the color (red or black). These colors are
used to ensure that the tree remains balanced during insertions and deletions.
Although the balance of the tree is not perfect, it is good enough to reduce the
searching time and maintain it around O(log n) time, where n is the total number of
elements in the tree .
7
CONCLUSION
A tree is non-linear and a hierarchical data structure consisting of a collection of nodes
such that each node of the tree stores a value and a list of references to other nodes
(the “children”).
Recursive Definition:
A tree consists of a root, and zero or more subtrees T1, T2, … , Tk such that there is
an edge from the root of the tree to the root of each subtree.
References
[1] Introduction to Algorithms (Third Edition) by Thomas H. Cormen, Charles E.
Leiserson, Ronald L. Livest and Clifford Stein.
[2] https://en.wikipedia.org/wiki/List_of_data_structures