WorksheetsAlgorithm Analysis, AVL Trees, and B-Trees Quiz
Total questions: 40
Worksheet time: 20mins
Name
Class
Date
1.
What is the worst-case time complexity of linear search?
a)
O(1)
b)
O(log n)
c)
O(n)
d)
O(n log n)
2.
What is the balance factor of a node in an AVL tree?
a)
Height(left) - Height(right)
b)
Height(node)
c)
Depth of node
d)
none of the above
3.
Maximum number of children for a B-Tree node of order m is
a)
m-1
b)
m
c)
m+1
d)
2m
4.
Which of the following is not an asymptotic notation?
a)
Big-O
b)
Theta
c)
Alpha
d)
Omega
5.
The best-case complexity of linear search is:
a)
O(1)
b)
O(n)
c)
O(log n)
d)
O(n log n)
6.
What is space complexity?
a)
Amount of time an algorithm takes
b)
Amount of memory an algorithm uses
c)
Complexity of nested loops
d)
Recursion depth
7.
Which notation denotes the lower bound?
a)
O
b)
θ
c)
Ω
d)
o
8.
If f(n) = 3n² + 2n + 1, then f(n) is:
a)
O(n)
b)
O(n²)
c)
O(n³)
d)
O(log n)
9.
Which of the following is not a valid asymptotic notation?
a)
O(n)
b)
Ω(n)
c)
α(n)
d)
θ(n)
10.
If an algorithm has a complexity of O(n!), it is considered:
a)
Linear
b)
Polynomial
c)
Exponential
d)
Factorial
11.
Which function grows faster?
a)
log n
b)
n
c)
n log n
d)
2ⁿ
12.
In asymptotic analysis, which case is usually considered?
a)
Best
b)
Worst
c)
Average
d)
Worst and average
13.
Which is useful for analyzing recursive algorithms?
a)
Space complexity
b)
Master theorem
c)
Hashing
d)
Graphs
14.
What is the logarithmic time complexity function?
a)
O(n)
b)
O(log n)
c)
O(n²)
d)
O(1)
15.
Which notation denotes 'at most'?
a)
O
b)
Ω
c)
θ
d)
∞
16.
Which complexity is fastest for large inputs?
a)
O(log n)
b)
O(n)
c)
O(n log n)
d)
O(n²)
17.
Correct order of growth?
a)
O(1) < O(log n) < O(n) < O(n²)
b)
O(n²) < O(n log n) < O(n)
c)
O(n) < O(log n) < O(1)
d)
O(n) < O(n²) < O(log n)
18.
Accessing an array element has complexity:
a)
O(n)
b)
O(log n)
c)
O(1)
d)
O(n²)
19.
AVL stands for:
a)
Algorithmic Variable Lookup
b)
Adelson-Velsky and Landis
c)
Advanced Variable List
d)
None
20.
AVL trees are:
a)
Linked lists
b)
Balanced binary search trees
c)
Heaps
d)
Graphs
21.
Max balance factor in AVL trees?
a)
2
b)
1
c)
0
d)
-1
22.
Rotation for Left-Right case in AVL tree?
a)
Left Rotation
b)
Right Rotation
c)
Left-Right Rotation
d)
Right-Left Rotation
23.
Insertion in AVL trees can cause:
a)
Search failure
b)
Imbalance
c)
Sorting
d)
Traversal errors
24.
Rotation for Right-Right case?
a)
Left Rotation
b)
Right Rotation
c)
Double Rotation
d)
None
25.
Height of AVL tree with `n` nodes is:
a)
O(log n)
b)
O(n)
c)
O(n²)
d)
O(1)
26.
Insertion in AVL takes:
a)
O(1)
b)
O(log n)
c)
O(n)
d)
O(n log n)
27.
Traversal used for sorting AVL elements?
a)
Pre-order
b)
In-order
c)
Post-order
d)
Level-order
28.
When is AVL tree balanced?
a)
All nodes left
b)
All nodes have 2 children
c)
Balance factor is -1, 0, or +1
d)
Height is zero
29.
AVL is subtype of:
a)
Heap
b)
B-Tree
c)
BST
d)
Stack
30.
AVL trees are better than unbalanced BSTs for:
a)
Root access
b)
Insertion
c)
Large data search
d)
Stacking
31.
AVL tree deletion complexity:
a)
O(log n)
b)
O(n²)
c)
O(n)
d)
O(1)
32.
B-Trees are used in:
a)
RAM
b)
Disk storage
c)
Caches
d)
Networks
33.
Min number of keys in B-Tree of order `m`?
a)
m
b)
m-1
c)
⌈m/2⌉ - 1
d)
m/2
34.
Where is insertion done in B-Trees?
a)
Root
b)
Internal
c)
Leaf
d)
Random
35.
B-Trees are:
a)
Binary
b)
Unbalanced
c)
Multiway balanced
d)
String-only
36.
When does B-Tree split?
a)
Leaf is full
b)
Root is full
c)
Node overflows
d)
Deletion
37.
Search time in B-Tree of height `h`:
a)
O(h)
b)
O(n)
c)
O(h²)
d)
O(1)
38.
Disk I/O improved in B-Trees by:
a)
Fewer nodes
b)
Reduced height
c)
Binary treeing
d)
Array use
39.
B-Trees are best suited for:
a)
In-memory data
b)
Small DBs
c)
File systems
d)
Stack ops
40.
Max children in B-Tree of order `m`:
a)
m-1
b)
m
c)
m+1
d)
2m
100 %
