wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

data structure quizizzzs

Total questions: 53

Worksheet time: 27mins

Name
Class
Date
1.

Who invented AVL Trees?

a)

Donald Knuth


b)

Adelson-Velsky and Landis

c)

Alan Turing

d)

Charles Babbage

2.

What is the balance factor in an AVL tree?

a)

Difference in height of left and right subtrees

b)

Sum of all node values

c)

Number of children

d)

None of the above

3.

What type of rotation is used for an LR imbalance?

a)

Right rotation

b)

Left rotation

c)

Right-Left rotation

d)

Left-Right rotation

4.

What is the time complexity for searching in an AVL tree?

a)

O(n)

b)
O(log n)
c)

O(1)

d)

O(n log n)

5.

Which is not true about AVL trees?

a)

They are always balanced

b)

Insertion may require rebalancing

c)

Deletion is not allowed

d)

Searching is efficient

6.

What is the maximum height difference allowed in an AVL tree?

a)

1

b)

2

c)

3

d)

4

7.

Which operation is performed to maintain the balance of an AVL tree?

a)

Searching

b)

Sorting

c)

Rebalancing

d)

Traversal

8.

What is the primary advantage of using AVL trees over regular binary search trees?

a)

They require less memory

b)

They guarantee O(log n) height

c)

They allow duplicate values

d)

They are easier to implement

9.

Which of the following operations can cause an AVL tree to become unbalanced?

a)

Only insertion

b)

Only deletion

c)

Both insertion and deletion

d)

Traversal

10.

Which of the following is a characteristic of AVL trees?

a)

They are implemented using linked lists

b)

They do not allow duplicate keys

c)

They are a type of self-balancing binary search tree

d)

They can have a balance factor of 2

11.

What happens to the balance factor of an AVL tree after a rotation?

a)

It becomes zero

b)

It may change but remains within -1 to 1

c)

It becomes negative

d)

It is reset to a fixed value

12.

Which traversal method is commonly used to display the elements of an AVL tree in sorted order?

a)

Level-order

b)

Pre-order

c)

In-order

d)

Post-order

13.

What is the primary purpose of rotations in an AVL tree?

a)

To improve search efficiency

b)

To maintain balance

c)

To increase the height of the tree

d)

To decrease the number of nodes

14.

Which of the following is a common application of AVL trees?

a)

Database indexing

b)

File compression

c)

Image processing

d)

Network routing

15.

What is the result of a left rotation on a node in an AVL tree?

a)

The node remains unchanged

b)

The node becomes the left child of its right child

c)

The node is deleted

d)

The node becomes the right child of its left child

16.

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)

a)

membership, cardinality

b)

intersection, membership

c)

union, intersection

d)

union only

17.

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

a)

Θ(n)

b)

Θ(logn)

c)

Θ(log*n)

d)

Θ(1)

18.

A series of values stored in memory is called ___

a)

an array

b)

a tree

c)

a matrix

d)

a struct

19.

In some languages, arrays are also called ___

a)

groups or arrows

b)

roots or leaves

c)

lists or vectors

d)

lines or strings

20.

Example of linear data structure except

a)

array

b)

tree

c)

queue

d)

stack

21.

Which one of the following is not the application of the stack data structure

a)

string reversal

b)

Recursion

c)

backtracking

d)

Asynchronous data transfer

22.

If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for the removal?

a)

1234

b)

2134

c)

4321

d)

4231

23.

Which of the following principle does Queue use?

a)

LIFO Principle

b)

FIFO Principle

c)

Linear tree

d)

Ordered tree

24.

Which of the following represents the Postorder Traversal of a Binary Tree ?

a)

Left -> Right -> Root

b)

Left -> Root -> Right

c)

Right -> Left -> Root

d)

Right -> Root -> Left

25.

Minimum number of fields in each node of a doubly linked list is ____

a)

1

b)

2

c)

3

d)

4

26.

What is an AVL tree?

a)

a) a tree which is balanced and is a height balanced tree

b)

b) a tree which is unbalanced and is a height balanced tree

c)

c) a tree with three children

d)

d) a tree with atmost 3 children

27.

Why we need to a binary tree which is height balanced?

a)

a) to avoid formation of skew trees

b)

b) to save memory

c)

c) to attain faster memory access

d)

d) to simplify storing

28.

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)

a) true

b)

b) false

29.

A height balanced binary search tree is called__________

a)

height tree

b)

AVL tree

c)

binary tree

d)

binary search tree

30.

The balancing factor for AVL tree =

a)

hL-hR

b)

hR-hL

c)

hL-hL

d)

hR-hR

31.

For RL imbalance which rotation is need to balance the tree

a)

Single LL rotation

b)

Single RR rotation

c)

LL and RR rotation

d)

None

32.

Which of the following is a double rotation

a)

LL rotation

b)

RR rotation

c)

RL rotation

d)

None

33.

The sequence of insertion 10,12,14 will lead to imbalance by using which rotation can be used to balance the tree

a)

RR rotation

b)

LL rotation

c)

LR rotation

d)

RL rotation

34.

The sequence of insertion 25,12,9 will lead to imbalance by using which rotation can be used to balance the tree

a)

RR rotation

b)

LL rotation

c)

RL rotation

d)

LR rotation

35.

Which of the following is the most widely used external memory data structure?

a)

AVL tree

b)

B-tree

c)

Red-black tree

d)

Both AVL tree and Red-black tree

36.

What are null nodes filled with in a threaded binary tree?

a)

they remain null

b)

right node with inorder predecessor and left node with inorder successor information

c)

inorder predecessor for left node and inorder successor for right node information

d)

some other values randomly

37.

Properties of B-Tree

a)

All the leaf nodes are at the same level

b)

elements towards left are less than parent and right are greater than parents

c)

Data is arranged in an ordered manner either ascending or descending order

d)

All the mentioned

38.

The maximum , minimum child for the root node in B-Tree

a)

m,0

b)

m-1,0

c)

0,m

d)

0,m-1

39.

The maximum, minimum keys/data at root node in B-Tree

a)

0,m-1

b)

m-1,0

c)

1,m-1

d)

m-1,1

40.

The maximum, minimum child for internal node in B-tree

a)

m/2,m

b)

m,m/2

c)

m,m/2-1

d)

m/2-1,m

41.

The maximum, minimum child for internal node in B-tree

a)

m/2,m

b)

m,m/2

c)

m,m/2-1

d)

m/2-1,m

42.

The maximum,minimum keys/data in B-Tree for Internal nodes is

a)

m/2-1, m-1

b)

m, m-1

c)

m-1,m/2-1

d)

m-1, m

43.

The maximum, minimum child for leaf node in B-tree

a)

0,0

b)

1,1

c)

m,m

d)

m-1,m-1

44.

The maximum, minimum data/keys at the leaf node in B-Tree

a)

m/2-1,m-1

b)

m, m/2

c)

m/2, m

d)

m-1, m/2-1

45.

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?

a)

Level 1

b)

Level 2

c)

Level 3

d)

Root

46.

What expression is represented by the tree?

a)

3+((5+9)2)3+\left(\left(5+9\right)\cdot2\right)

b)

3+5+923+5+9\cdot2

c)

(3+5+9)2\left(3+5+9\right)\cdot2

47.

Evaluate:

a)

31

b)

26

c)

34

d)

28

48.

Post order traversal :

a)

1a+b*c+d*e+f*g

b)

1abc*+de*f+g*+

c)

++a*bc*+*defg

d)

abc+*+defg*+*

49.

In Order traversal

a)

40 20 50 10 30

b)

40 50 20 30 10

c)

10 20 30 40 50

d)

50 40 20 30 10

50.
A Kind of tree where every node in a tree can have at most two children.
a)
Binary Tree
b)
Binary Expression Tree
c)
Tree
d)
Binary Search Tree
51.

Root

a)

data structure similar to a graph, with no loops.

b)

an object in a graph also known as a vertex

c)

a join of relationship between nodes - also know as an arc

d)

the starting node in a rooted tree structure from which all other nodes branch off./

52.

Binary TREE

a)

data structure similar to a graph, with no loops.

b)

an object in a graph also known as a vertex

c)

a join of relationship between nodes - also know as an arc

d)

a tree where each node can only have 2 child nodes attached to it

53.
In this tree, where would the new value "7" be placed?
a)
On the left "leaf" of "4"
b)
On the right "leaf" of "6"
c)
On the left "leaf" of "15"
d)
Over the top of the current number "5"