NEW
Font size
Worksheetsdata structure quizizzzs
Total questions: 53
Worksheet time: 27mins
Who invented AVL Trees?
Donald Knuth
Adelson-Velsky and Landis
Alan Turing
Charles Babbage
What is the balance factor in an AVL tree?
Difference in height of left and right subtrees
Sum of all node values
Number of children
None of the above
What type of rotation is used for an LR imbalance?
Right rotation
Left rotation
Right-Left rotation
Left-Right rotation
What is the time complexity for searching in an AVL tree?
O(n)
O(1)
O(n log n)
Which is not true about AVL trees?
They are always balanced
Insertion may require rebalancing
Deletion is not allowed
Searching is efficient
What is the maximum height difference allowed in an AVL tree?
1
2
3
4
Which operation is performed to maintain the balance of an AVL tree?
Searching
Sorting
Rebalancing
Traversal
What is the primary advantage of using AVL trees over regular binary search trees?
They require less memory
They guarantee O(log n) height
They allow duplicate values
They are easier to implement
Which of the following operations can cause an AVL tree to become unbalanced?
Only insertion
Only deletion
Both insertion and deletion
Traversal
Which of the following is a characteristic of AVL trees?
They are implemented using linked lists
They do not allow duplicate keys
They are a type of self-balancing binary search tree
They can have a balance factor of 2
What happens to the balance factor of an AVL tree after a rotation?
It becomes zero
It may change but remains within -1 to 1
It becomes negative
It is reset to a fixed value
Which traversal method is commonly used to display the elements of an AVL tree in sorted order?
Level-order
Pre-order
In-order
Post-order
What is the primary purpose of rotations in an AVL tree?
To improve search efficiency
To maintain balance
To increase the height of the tree
To decrease the number of nodes
Which of the following is a common application of AVL trees?
Database indexing
File compression
Image processing
Network routing
What is the result of a left rotation on a node in an AVL tree?
The node remains unchanged
The node becomes the left child of its right child
The node is deleted
The node becomes the right child of its left child
Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality will be the slowest? (GATE CS 2004)
membership, cardinality
intersection, membership
union, intersection
union only
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is
Θ(n)
Θ(logn)
Θ(log*n)
Θ(1)
A series of values stored in memory is called ___
an array
a tree
a matrix
a struct
In some languages, arrays are also called ___
groups or arrows
roots or leaves
lists or vectors
lines or strings
Example of linear data structure except
array
tree
queue
stack
Which one of the following is not the application of the stack data structure
string reversal
Recursion
backtracking
Asynchronous data transfer
If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for the removal?
1234
2134
4321
4231
Which of the following principle does Queue use?
LIFO Principle
FIFO Principle
Linear tree
Ordered tree
Which of the following represents the Postorder Traversal of a Binary Tree ?
Left -> Right -> Root
Left -> Root -> Right
Right -> Left -> Root
Right -> Root -> Left
Minimum number of fields in each node of a doubly linked list is ____
1
2
3
4
What is an AVL tree?
a) a tree which is balanced and is a height balanced tree
b) a tree which is unbalanced and is a height balanced tree
c) a tree with three children
d) a tree with atmost 3 children
Why we need to a binary tree which is height balanced?
a) to avoid formation of skew trees
b) to save memory
c) to attain faster memory access
d) to simplify storing
To restore the AVL property after inserting a element, we start at the insertion point and move towards root of that tree. is this statement true?
a) true
b) false
A height balanced binary search tree is called__________
height tree
AVL tree
binary tree
binary search tree
The balancing factor for AVL tree =
hL-hR
hR-hL
hL-hL
hR-hR
For RL imbalance which rotation is need to balance the tree
Single LL rotation
Single RR rotation
LL and RR rotation
None
Which of the following is a double rotation
LL rotation
RR rotation
RL rotation
None
The sequence of insertion 10,12,14 will lead to imbalance by using which rotation can be used to balance the tree
RR rotation
LL rotation
LR rotation
RL rotation
The sequence of insertion 25,12,9 will lead to imbalance by using which rotation can be used to balance the tree
RR rotation
LL rotation
RL rotation
LR rotation
Which of the following is the most widely used external memory data structure?
AVL tree
B-tree
Red-black tree
Both AVL tree and Red-black tree
What are null nodes filled with in a threaded binary tree?
they remain null
right node with inorder predecessor and left node with inorder successor information
inorder predecessor for left node and inorder successor for right node information
some other values randomly
Properties of B-Tree
All the leaf nodes are at the same level
elements towards left are less than parent and right are greater than parents
Data is arranged in an ordered manner either ascending or descending order
All the mentioned
The maximum , minimum child for the root node in B-Tree
m,0
m-1,0
0,m
0,m-1
The maximum, minimum keys/data at root node in B-Tree
0,m-1
m-1,0
1,m-1
m-1,1
The maximum, minimum child for internal node in B-tree
m/2,m
m,m/2
m,m/2-1
m/2-1,m
The maximum, minimum child for internal node in B-tree
m/2,m
m,m/2
m,m/2-1
m/2-1,m
The maximum,minimum keys/data in B-Tree for Internal nodes is
m/2-1, m-1
m, m-1
m-1,m/2-1
m-1, m
The maximum, minimum child for leaf node in B-tree
0,0
1,1
m,m
m-1,m-1
The maximum, minimum data/keys at the leaf node in B-Tree
m/2-1,m-1
m, m/2
m/2, m
m-1, m/2-1
Draw a binary tree where A is the parent of B and C, B is a parent of D and E, E is a parent of F. G and H are children of C, and I and J are children of H.
On what level is J?
Level 1
Level 2
Level 3
Root
What expression is represented by the tree?
3+((5+9)⋅2)
3+5+9⋅2
(3+5+9)⋅2
Evaluate:
31
26
34
28
Post order traversal :
1a+b*c+d*e+f*g
1abc*+de*f+g*+
++a*bc*+*defg
abc+*+defg*+*
In Order traversal
40 20 50 10 30
40 50 20 30 10
10 20 30 40 50
50 40 20 30 10
Root
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
Binary TREE
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
a tree where each node can only have 2 child nodes attached to it
