Font size
S
M
L
XL
WorksheetsLearnTube Data Structure and Algorithm Quiz 11/2/23
Total questions: 42
Worksheet time: 29mins
Name
Class
Date
1.
Full Name ?
4 lines
2.
Email id ?
4 lines
3.
Phone Number ?
4 lines
4.
What is a dynamic array?
a)
An array whose size can change dynamically.
b)
An array whose elements can change dynamically.
c)
An array whose elements and size can change dynamically.
d)
A linked list where each node has one pointer to the next node.
5.
What is the time complexity of accessing an element in an array?
a)
O(1)
b)
O(n)
c)
O(log n)
d)
None
6.
What is the time complexity of inserting an element at the end of an array?
a)
O(1)
b)
O(n)
c)
O(log n)
d)
None
7.
What is the time complexity of inserting an element at the beginning of an array?
a)
O(1)
b)
O(n)
c)
O(log n)
d)
None
8.
What is the time complexity of deleting an element from an array?
a)
O(1)
b)
O(n)
c)
O(log n)
d)
None
9.
What is a stack?
a)
A linear data structure that follows the Last-In-First-Out (LIFO) order.
b)
A linear data structure that leads the Last-In-First-Out (LIFO) order.
c)
A linear data structure that follows the First-In-First-Out (FIFO) order.
d)
A non-linear data structure.
e)
A non-linear data structure.
10.
What is a queue?
a)
A linear data structure that follows the Last-In-First-Out (LIFO) order.
b)
A linear data structure that leads the Last-In-First-Out (LIFO) order.
c)
A linear data structure that follows the First-In-First-Out (FIFO) order.
d)
A non-linear data structure.
e)
A non-linear data structure.
11.
What is a circular queue?
a)
A queue where the front and rear pointers wrap around the end of the queue.
b)
A queue where the front and rear pointers do not wrap around the end of the queue.
c)
A queue where only the front pointer wraps around the end of the queue.
12.
How was the Quiz ?
a)
Poor (1-6)
b)
Good (7-8)
c)
Excellent (9-10)
13.
What is a priority queue?
a)
A queue where elements are assigned a priority and are served based on their priority.
b)
A queue where elements are served based on their arrival time.
c)
A queue where elements are served randomly.
14.
What is a deque (double ended queue)?
a)
A queue where elements can be inserted or deleted from both the front and rear.
b)
A queue where elements can be inserted or deleted from only the front.
c)
A queue where elements can be inserted or deleted from only the rear.
15.
What is a tree data structure?
a)
A hierarchical data structure that consists of nodes and edges.
b)
A linear data structure that consists of nodes and edges.
c)
A non-linear data structure that consists of nodes and edges.
16.
What is the root node in a tree?
a)
The first node in a tree.
b)
The last node in a tree.
c)
The node that has no parent.
17.
What is a binary tree?
a)
A tree where each node has at most two children.
b)
A tree where each node has at most three children.
c)
A tree where each node has at most four children.
18.
What is an AVL tree?
a)
A binary search tree where the height difference between the left and right subtree of any node is at most 1.
b)
A binary search tree where the height difference between the left and right subtree of any node is at most 2.
c)
A binary search tree where the height difference between the left and right subtree of any node is at most 3.
19.
What is a Trie?
a)
A tree-like data structure that is used to store an associative array where the keys are sequences (usually string
b)
A tree-like data structure that is used to store an associative array where the keys are numbers.
c)
A tree-like data structure that is used to store an associative array where the keys are dates.
d)
A tree-like data structure that is used to store an associative array where the keys are dates.
20.
What is the time complexity of inserting an element into a Heap?
a)
O(log n)
b)
O(n)
c)
O(n log n)
d)
None
21.
What is the time complexity of deleting an element from a Heap?
a)
O(log n)
b)
O(n)
c)
O(n log n)
d)
None
22.
What is the time complexity of searching an element in a Heap?
a)
O(log n)
b)
O(n)
c)
O(n log n)
d)
None
23.
How was the Quiz ?
a)
Basic
b)
Advance
24.
What is the time complexity of finding the minimum or maximum element in a Heap?
a)
O(log n)
b)
O(n)
c)
O(n log n)
d)
None
25.
What is the height of a complete binary tree with 2^k nodes?
a)
k
b)
k+1
c)
k-1
26.
What is the height of a complete binary tree with n nodes?
a)
log2(n)
b)
log2(n) - 1
c)
log2(n) + 1
27.
What is a Graph data structure?
a)
A collection of nodes and edges representing relationships between objects.
b)
A collection of nodes and trees representing relationships between objects.
c)
A collection of nodes and sets representing relationships between objects
28.
What is a directed Graph?
a)
A Graph where edges have a direction and go from one node to another.
b)
A Graph where edges do not have a direction and go from one node to another.
c)
A Graph where edges have a direction but do not go from one node to another.
29.
What is an undirected Graph?
a)
A Graph where edges have a direction and go from one node to another.
b)
A Graph where edges do not have a direction and go from one node to another.
c)
A Graph where edges have a direction but do not go from one node to another.
30.
What is a weighted Graph?
a)
A Graph where each edge has a weight or cost associated with it.
b)
A Graph where each node has a weight or cost associated with it.
c)
A Graph where there is no weight or cost associated with any edge or node.
31.
What is an adjacency matrix?
a)
A representation of a Graph where a matrix is used to store the edges and their weights.
b)
A representation of a Graph where a list is used to store the edges and their weights.
c)
A representation of a Graph where an array is used to store the edges and their weights.
32.
What is Breadth First Search (BFS)?
a)
A Graph traversal technique where nodes are visited in the order of their distance from the source node.
b)
A Graph traversal technique where nodes are visited in the reverse order of their distance from the source node.
c)
A Graph traversal technique where nodes are visited in a random order
33.
What is Depth First Search (DFS)?
a)
A Graph traversal technique where nodes are visited in the order of their distance from the source node.
b)
A Graph traversal technique where nodes are visited in a depth-first manner, exploring as far as possible along each branch before backtracking.
c)
A Graph traversal technique where nodes are visited in a random order.
34.
What is a Greedy Algorithm?
a)
An algorithm that always makes the locally optimal choice at each stage.
b)
An algorithm that always makes the globally optimal choice at each stage.
c)
An algorithm that always makes a random choice at each stage.
35.
What is the difference between a Greedy Algorithm and Dynamic Programming?
a)
A Greedy Algorithm only makes the best choice at the moment, whereas Dynamic Programming considers the entire problem to find the best solution.
b)
A Dynamic Programming algorithm only makes the best choice at the moment, whereas a Greedy Algorithm considers the entire problem to find the best solution.
c)
A Greedy Algorithm and Dynamic Programming are the same thing.
36.
What is the Activity Selection Problem?
a)
A problem where you are given a set of activities with start and finish times and you need to find the maximum number of non-overlapping activities that can be completed.
b)
A problem where you are given a set of activities with start and finish times and you need to find the minimum number of overlapping activities that can be completed.
c)
A problem where you are given a set of activities with start and finish times and you need to find all the possible activities that can be completed.
37.
What is the Fractional Knapsack Problem?
a)
A problem where you are given a set of items with weights and values and a knapsack with a limited capacity, and you need to find the maximum total value of items that can be placed in the knapsack.
b)
A problem where you are given a set of items with weights and values and a knapsack with a limited capacity, and you need to find the minimum total value of items that can be placed in the knapsack.
c)
A problem where you are given a set of items with weights and values and a knapsack with an unlimited capacity, and you need to find the maximum total value of items that can be placed in the knapsack.
38.
What is Recursion?
a)
A method of solving a problem by breaking it down into smaller sub-problems.
b)
A method of solving a problem by dividing it into several equal parts.
c)
A method of solving a problem by brute force.
39.
What is the base case in a Recursive Algorithm?
a)
The smallest sub-problem that can be solved without recursion.
b)
The largest sub-problem that can be solved without recursion.
c)
The first sub-problem that is solved without recursion.
40.
What is the general idea behind a Recursive Algorithm?
a)
To solve the problem by breaking it down into smaller sub-problems and solving those sub-problems.
b)
To solve the problem by brute force.
c)
To solve the problem by dividing it into several equal parts.
41.
What is the main advantage of Recursion over Iteration?
a)
Recursion is more efficient than iteration.
b)
Recursion is easier to understand and implement than iteration.
c)
Recursion is more flexible than iteration.
42.
What is the main disadvantage of Recursion over Iteration?
a)
Recursion is more efficient than iteration.
b)
Recursion is harder to understand and implement than iteration.
c)
Recursion is less flexible than iteration.
Reset
