DS - Questions Sheet
DS - Questions Sheet
B) To encrypt data
C) To delete data
A) Size
B) Correctness
Time Complexity, space
C) Color complexity
D) Shape
4. In which case does a data structure operation take the maximum time?
A) Best Case
B) Average Case
C) Worst Case
D) Optimal Case
5. Which of the following is a non-linear data structure?
A) Array
B) Stack
C) Queue
D) Tree
A) Non-linear
B) Linear
C) Hierarchical
D) Graph
A) Array
B) Stack
C) Linked List
D) Queue
A) Insertion
B) Deletion
C) Searching
A) 0
B) 1
C) -1
A) Integer
B) String
Derived
C) List
D) Boolean
A) Tree
B) Graph
C) Map
D) Array
A) Complexity
B) Wastage of memory
C) Speed
D) Accessibility
13.Which of the following is an example of a derived data type?
A) Integer
B) Character
C) Stack
D) Float
B) Deleting an element
D) Updating an element
A) Deletion
B) Insertion
C) Traversing
D) Searching
A) O(n)
B) O(log n)
C) O(1)
D) O(n^2)
17.What is a record in the context of data structures?
B) A collection of fields
C) A collection of arrays
A) Insertion
B) Deletion
C) Traversal
D) Sorting
21.What is the main drawback of using static arrays?
B) Difficulty in resizing
D) Complexity of implementation
A) Stack
B) Queue
C) Array
D) Linked List
A) To sort data
C) To delete data
D) A collection of records
25.What does the term "merge" refer to in data structures?
B) Deleting elements
D) Sorting elements
A) Insertion
B) Deletion
C) Traversal
D) Searching
A) Only data
D) Only a pointer
C) Easy to traverse
D) Fixed size
29.Which operation in an array can often lead to shifting elements?
B) Search
C) Traversal
B) A characteristic of an entity
A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
#include <iostream>
using namespace std;
int main() {
int arr[] = {1, 2, 3, 4, 5}; // Declare and initialize the array
cout << arr[2] << endl; // Print the element at index 2
cout << arr[4] << endl; // Print the element at index 4
return 0; // Indicate successful completion
}
A. 3 and 5
B. 5 and 3
C. 2 and 4
D. 4 and 2
A. randomly
B. sequentially
C. exponentially
D. logarithmically
A. 0
B. -1
C. 2
D. 1
A. O(1)
B. O(n)
C. O(log n)
D. O(n^2)
A. It decreases by 1
B. It remains the same
C. It increases by 1
D. It doubles
A. O(1)
B. O(n)
C. O(log n)
D. O(n^2)
A. O(log n)
B. O(n)
C. O(1)
D. O(n^2)
A. It decreases by 1
B. It remains the same
C. It increases by 1
D. It doubles
A. O(1)
B. O(log n)
C. O(n)
D. O(n²)
48.In a linear search, how many elements must be checked in the worst
case?
A. n
B. n/2
C. 1
D. log(n)
True/False Questions
56.A linked list consists of nodes that store data and pointers to the next node.
57.The average case of a data structure operation refers to the worst time taken.
60.In a queue, the last element added is the first one to be removed.
efficiency.
68.Arrays are best suited for situations requiring frequent insertions and
deletions.
69.The worst-case scenario for a data structure operation is always the same for
all operations.
71.The execution time cases include worst case, average case, and best case.
73.A data structure can be both linear and non-linear at the same time.
78.In a static linear data structure, memory cannot be resized after allocation.
79.The main advantage of arrays is their ability to support dynamic sizes.