Data Sructure and Algrithm
Data Sructure and Algrithm
Data Sructure and Algrithm
How many cases are there, which are used to compare various data
structure's execution time in a relative manner?
A. 2
B. 3
C. 4
D. 5
A. Worst Case
B. Average Case
C. Best Case
D. None of the above
A. ƒ(n)
B. f(m)
C. mf(n)
D. nf(m)
A. Entity Set
B. Record
C. File
D. Field
A. Completeness
B. Correctness
C. Time Complexity
D. Space Complexity
7. Which data structure allows deleting data elements from front and inserting
at rear?
A. Stacks
B. Queues
C. Deques
D. Binary search tree
A. Bubble sort
B. Insertion sort
C. Quick sort
D. Selection sort
9. Which sorting algorithm has a time complexity of O(n^2) in the worst case?
a) Merge sort
b) Insertion sort
c) Quick sort
d) Radix sort
10. In which sorting algorithm does the largest element "bubble" to the end of
the list at each pass?
a) Bubble sort
b) Selection sort
c) Insertion sort
d) Heap sort
12. Which sorting algorithm is known for its in-place sorting nature?
a) Bubble sort
b) Selection sort
c) Merge sort
d) Insertion sort
13. Which sorting algorithm uses a pivot element to partition the list into two
sublists?
a) Bubble sort
b) Selection sort
c) Quick sort
d) Insertion sort
14. Which sorting algorithm is stable, preserving the relative order of elements
with equal keys?
a) Bubble sort
b) Selection sort
c) Quick sort
d) Merge sort
15. Which sorting algorithm has a time complexity of O(n log n) in the average
and worst cases?
a) Bubble sort
b) Selection sort
c) Quick sort
d) Insertion sort
16. Which sorting algorithm is efficient for large lists but requires additional
memory?
a) Bubble sort
b) Selection sort
c) Radix sort
d) Insertion sort
17. Which sorting algorithm can be used to sort elements with non-comparable
keys, such as strings?
a) Bubble sort
b) Selection sort
c) Merge sort
d) Radix sort
18. How many passes does an insertion sort algorithm consist of?
a) N
b) N-1
c) N+1
d) N2
19. What is the running time of an insertion sort algorithm if the input is pre-
sorted?
a) O(N2)
b) O(N log N)
c) O(N)
d) O(M log N)
20. Which of the following examples represent the worst case input for an
insertion sort?
a) array in sorted order
b) array sorted in reverse order
c) normal unsorted array
d) large array
21. In the following scenarios, when will you use selection sort?
a) The input is already sorted
b) A large file has to be sorted
c) Large values need to be sorted with small keys
d) Small values need to be sorted with large keys
22. What is the advantage of selection sort over other sorting techniques?
a) It requires no additional storage space
b) It is scalable
c) It works best for inputs which are already sorted
d) It is faster than any other sorting technique
29. What will be the best case time complexity of merge sort?
a) O(n log n)
b) O(n2)
c) O(n2 log n)
d) O(n log n2)
33. Which of the following sorting algorithm does not use recursion?
a) quick sort
b) merge sort
c) heap sort
d) bottom up merge sort
34. What is the worst case time complexity of a quick sort algorithm?
a) O(N)
b) O(N log N)
c) O(N2)
d) O(log N)
35. Which of the following methods is the most effective for picking the pivot
element?
a) first element
b) last element
c) median-of-three partitioning
d) random element
40. What is the worst case complexity of binary search using recursion?
a) O(nlogn)
b) O(logn)
c) O(n)
d) O(n2)
41. What is the average case time complexity of binary search using recursion?
a) O(nlogn)
b) O(logn)
c) O(n)
d) O(n2)
43. A linear collection of data elements where the linear node is given by means
of pointer is called?
A. linked list
B. node list
C. primitive list
D. None of these
44. What is the time complexity to count the number of elements in the linked
list?
A. O(1)
B. O(n)
C. O(logn)
D. None of the mentioned
45. Linked lists are not suitable to for the implementation of?
A. Insertion sort
B. Radix sort
C. Polynomial manipulation
D. Binary search
A. Pointer to character
B. Pointer to integer
C. Pointer to node
D. Node
48. What kind of linked list is best to answer question like "What is the item at
position n"?
A. Dynamic
B. Static
C. Compile time
D. None of the mentioned
A. Data
B. Link
C. Data and Link
D. None of the mentioned
A. Create
B. Push
C. Evaluation
D. Pop
52. In a stack, if a user tries to remove an element from empty stack it is called
_________.
A. Underflow
B. Empty collection
C. Overflow
D. Garbage Collection
A. Create
B. Push
C. Evaluation
D. Pop
54. The process of accessing data stored in a serial access memory is similar to
manipulating data on a ________
A. Heap
B. Binary Tree
C. Array
D. Stack
A. Insertion
B. Deletion
C. To empty a queue
D. Both Insertion and To empty a queue
56. A linear list of elements in which deletion can be done from one end (front)
and insertion can take place only at the other end (rear) is known as a ?
A Queue
B Stack
C. Tree
D. Linked list
57. A queue is a ?
A. Stack
B. Queue
C. Linked list
D. None of the mentioned
59. A data structure in which elements can be inserted or deleted at/from both
the ends but not in the middle is?
A. Queue
B. Circular queue
C. Dequeue
D. Priority queue
A. Simulation of recursion
B. Simulation of arbitrary linked list
C. Simulation of limited resource allocation
D. All of the mentioned
A. Ordinary queue
B. Single ended queue
C. Circular queue
D. Priority queue
62.