Beruflich Dokumente
Kultur Dokumente
grandparent are p and g respectively. Then, the three rotations are named
as:
Zig: If p is the root and v is the left child of p, then left-left rotation at p would
suffice. This case always terminates the splay as v reaches the root after this
rotation.
Zig-Zig: If p is not the root, p is the left child and v is also a left child, then a leftleft rotation at g followed by a left-left rotation at p, brings v as an ancestor of g as
well as p.
Zig-Zag: If p is not the root, p is the left child and v is a right child, perform a
left-right rotation at g and bring v as an ancestor of p as well as g.
8. Define Heap.
A heap is defined to be a complete binary tree with the property that the
value of each node is atleast as small as the value of its child nodes, if
they exist. The root node of the heap has the smallest value in the tree.
9. What is the minimum number of nodes in an AVL tree of height h?
The minimum number of nodes S(h), in an AVL tree of height h is given
by S(h)=S(h-1)+S(h-2)+1. For h=0, S(h)=1.
10. Define B-tree of order M.
A B-tree of order M is a tree that is not binary with the following
structural properties:
The root is either a leaf or has between 2 and M children.
All non-leaf nodes (except the root) have between M/2 and M
children. All leaves are at the same depth.
11. What do you mean by 2-3 tree?
A B-tree of order 3 is called 2-3 tree. A B-tree of order 3 is a tree that is
not binary with the following structural properties:
The root is either a leaf or has between 2 and 3 children.
All non-leaf nodes (except the root) have between 2 and 3
children. All leaves are at the same depth.
12. What do you mean by 2-3-4 tree?
A B-tree of order 4 is called 2-3-4 tree. A B-tree of order 4 is a tree that is
not binary with the following structural properties:
The root is either a leaf or has between 2 and 4 children.
All non-leaf nodes (except the root) have between 2 and 4
children. All leaves are at the same depth.
13. What are the applications of B-tree?
Database implementation
Indexing on non primary key fields
pushing the hole down one level. We repeat this step until X can be placed in the
hole. Thus, our action is to place X in its correct spot along a path from the root
containing minimum children. This general strategy is known as percolate down.
PART- B
What is a Binary heap? Explain binary heap?
Definition of Binary heap Properties of binary heap Example
Explain Splay tree in detail
Definition Creation Types of rotation
Explain B-tree representation?
Node representation of B-tree
Implicit array representation of B-tree
Implementation of various operations
What is a Priority Queue? What are its types? Explain.
Definition of Priority queue
Types: Ascending and Descending priority queue
Implementation of priority queue
Explain AVL tree in detail
Definition
Creation
Types of rotation
Deletion