You are on page 1of 12

1.

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

2. Which case of data structure operation takes maximum time?

A. Worst Case
B. Average Case
C. Best Case
D. None of the above

3. In Average case, if operation takes ƒ(n) time in execution, then m operations


will take?

A. ƒ(n)
B. f(m)
C. mf(n)
D. nf(m)

4. __________ is a single elementary unit of information representing an


attribute of an entity.

A. Entity Set
B. Record
C. File
D. Field

5. Which of the following is not a Characteristics of a Data Structure?

A. Completeness
B. Correctness
C. Time Complexity
D. Space Complexity

6. O(1) means computing time is __________________


A. Constant
B. Quadratic
C. Linear
D. Cubic

7. Which data structure allows deleting data elements from front and inserting
at rear?

A. Stacks
B. Queues
C. Deques
D. Binary search tree

8. Which of the following sorting algorithm is of divide-and-conquer type?

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

11. Which sorting algorithm has a best-case time complexity of O(n)?


a) Bubble sort
b) Selection sort
c) Merge sort
d) Insertion 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

23. What is an external sorting algorithm?


a) Algorithm that uses tape or disk during the sort
b) Algorithm that uses main memory during the sort
c) Algorithm that involves swapping
d) Algorithm that are considered ‘in place’

24. What is an internal sorting algorithm?


a) Algorithm that uses tape or disk during the sort
b) Algorithm that uses main memory during the sort
c) Algorithm that involves swapping
d) Algorithm that are considered ‘in place’

25. What is the worst case complexity of bubble sort?


a) O(nlogn)
b) O(logn)
c) O(n)
d) O(n2)

26. What is the average case complexity of bubble sort?


a) O(nlogn)
b) O(logn)
c) O(n)
d) O(n2)

27. What is the auxiliary space complexity of merge sort?


a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)
28. What is the worst case time complexity of merge sort?
a) O(n log n)
b) O(n2)
c) O(n2 log n)
d) O(n log n2)

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)

30. Which of the following is not a variant of merge sort?


a) in-place merge sort
b) bottom up merge sort
c) top down merge sort
d) linear merge sort

31. Which of the following is not in place sorting algorithm by default?


a) merge sort
b) quick sort
c) heap sort
d) insertion sort

32. Which of the following is not a stable sorting algorithm?


a) Quick sort
b) Cocktail sort
c) Bubble sort
d) Merge sort

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

36. What is the average running time of a quick sort algorithm?


a) O(N2)
b) O(N)
c) O(N log N)
d) O(log N)

37. Where is linear searching used?


a) When the list has only a few elements
b) When performing a single search in an unordered list
c) Used all the time
d) When the list has only a few elements and When performing a single
search in an unordered list

38. What is the best case for linear search?


a) O(nlogn)
b) O(logn)
c) O(n)
d) O(1)

39. What is the worst case for linear search?


a) O(nlogn)
b) O(logn)
c) O(n)
d) O(1)

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)

42. Which of the following is not an application of binary search?


a) To find the lower/upper bound in an ordered sequence
b) Union of intervals
c) Debugging
d) To search in unordered list

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

46. Which of these is an application of linked lists?

A. To implement file systems


B. For separate chaining in hash-tables
C. To implement non-binary trees
D. All of the mentioned
47. In linked list each node contain minimum of two fields. One field is data field
to store the data second field is?

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. Singly linked list


B. Doubly linked list
C. Circular linked list
D. Array implementation of linked list

49. Linked list is considered as an example of ___________ type of memory


allocation.

A. Dynamic
B. Static
C. Compile time
D. None of the mentioned

50. In Linked List implementation, a node carries information regarding

A. Data
B. Link
C. Data and Link
D. None of the mentioned

51. Process of inserting an element in stack is called ____________.

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

53. Process of removing an element from stack is called __________

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

55. In linked list implementation of queue, if only front pointer is maintained,


which of the following operation take worst case linear time?

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. FIFO (First In First Out) list


B. LIFO (Last In First Out) list
C. Ordered array
D. Linear tree
58. In Breadth First Search of Graph, which of the following data structure is
used?

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

60. Queues serve major role in

A. Simulation of recursion
B. Simulation of arbitrary linked list
C. Simulation of limited resource allocation
D. All of the mentioned

61. Which of the following is not the type of queue?

A. Ordinary queue
B. Single ended queue
C. Circular queue
D. Priority queue

62.

You might also like