Quiznetik

Data Structures (DS) | Set 3

1. In the following scenarios, when will you use selection sort?

Correct : C. Large values need to be sorted with small keys

2. What is the worst case complexity of selection sort?

Correct : D. O(n2)

3. What is the advantage of selection sort over other sorting techniques?

Correct : A. It requires no additional storage space

4. What is the average case complexity of selection sort?

Correct : D. O(n2)

5. What is the disadvantage of selection sort?

Correct : B. It is not scalable

6. The given array is arr = {3,4,5,2,1}. The number of iterations in bubble sort and selection sort respectively are,

Correct : A. 5 and 4

7. The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The number of iterations in selection sort and bubble sort respectively are,

Correct : D. 4 and 1

8. What is the best case complexity of selection sort?

Correct : D. O(n2)

9. Shell sort is also known as

Correct : B. diminishing increment sort

10. Statement 1: Shell sort is a stable sorting algorithm. Statement 2: Shell sort is an in-place sorting algorithm.

Correct : B. Statement 2 is true but statement 1 is false

11. Shell sort is applied on the elements 27 59 49 37 15 90 81 39 and the chosen decreasing sequence of increments is (5,3,1). The result after the first iteration will be

Correct : C. 27 59 39 37 15 90 81 49

12. Shell sort is an improvement on

Correct : A. insertion sort

13. An array that is first 7-sorted, then 5-sorted becomes

Correct : D. both 7-ordered and 5-ordered

14. If Hibbard increments (h1= 1, h2= 3, h3= 7, …, hk = 2k–1) are used in a Shell sortimplementation, then the best case time complexity will be

Correct : A. O(nlogn)

15. Records R1, R2, R3,.. RN with keys K1, K2, K3,.. KN are said to be h-ordered, if

Correct : D. Ki <= Ki+h for 1<= i <= N-h

16. Which of the following is true?

Correct : A. Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes do not completely sort the elements

17. Which of the following is the distribution sort?

Correct : D. LSD radix sort

18. What is the worst case time complexity of LSD radix sort?

Correct : B. O(wn)

19. LSD radix sort requires passes to sort N elements.

Correct : A. (w/logR)

20. Which of the following is false?

Correct : B. LSD radix sort is a comparison sorting algorithm

21. Which of the following sorting algorithm is stable?

Correct : D. LSD radix sort

22. Which of the following should be used to sort a huge database on a fixed-length key field?

Correct : C. LSD radix sort

23. Which of the following is a combination of LSD and MSD radix sorts?

Correct : A. Forward radix sort

24. Which of the following is true for the LSD radix sort?

Correct : B. accesses memory randomly

25. Which scheme uses a randomization approach?

Correct : C. universal hashing

26. Which hash function satisfies the condition of simple uniform hashing?

Correct : A. h(k) = lowerbound(km)

27. What is the hash function used in the division method?

Correct : B. h(k) = k mod m

28. What can be the value of m in the division method?

Correct : A. Any prime number

29. Which scheme provides good performance?

Correct : B. universal hashing

30. Using division method, in a given hash table of size 157, the key of value 172 be placed at position

Correct : C. 15

31. How many steps are involved in creating a hash function using a multiplication method?

Correct : D. 2

32. What is the hash function used in multiplication method?

Correct : A. h(k) = floor( m(kA mod 1))

33. What is the advantage of the multiplication method?

Correct : C. value of m not critical

34. What is the table size when the value of p is 7 in multiplication method of creating hash functions?

Correct : B. 128

35. What is the average retrieval time when n keys hash to the same slot?

Correct : A. Theta(n)

36. A ___________refers to a single unit of values.

Correct : C. data item.

37. Data items that are divided into subitems are called ___________.

Correct : B. group items.

38. Which of these best describes an array?

Correct : B. Container of objects of similar types

39. In _______________all the records contain the same data items with the same amount of space.

Correct : B. fixed-length records.

40. The logical or mathematical model of a particular organization of data is called a _______________.

Correct : A. data structure.

41. Arrays are best data structures for _____________________________.

Correct : A. relatively permanent collections of data.

42. How do the nested calls of the function get managed?

Correct : B. Through Stacks.

43. __________is combining the records in two different sorted files in to a single sorted file.

Correct : D. Merging.

44. In linear search algorithm the Worst case occurs when ____________.

Correct : D. The item is the last element in the array or is not there at all.

45. The complexity of Binary search algorithm is ____________.

Correct : B. O(log n ).

46. The complexity of Bubble sort algorithm is _________.

Correct : C. O(n2).

47. Inorder traversal of binary search tree will produce _______________.

Correct : B. sorted list.

48. Sub algorithms fall into two basic categories: function sub algorithms and ____________ sub algorithms.

Correct : A. procedure.

49. Two main measures for the efficiency of an algorithm are____________.

Correct : C. Time and space.

50. New data are to be inserted into a data structure, but there is no available space; this situation is usually called__________.

Correct : B. Overflow.

51. Which of the following data structure is linear data structure?

Correct : C. Array.

52. Which of the following is an example of dynamic programming approach?

Correct : D. All of the above

53. The memory address of the first element of an array is called_________.

Correct : D. base address.

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

Correct : B. Queues.

55. Binary search algorithm cannot be applied to________ concept.

Correct : A. unsorted linked list.

56. Graph traversal is different from a tree traversal, because

Correct : C. trees have root.

57. Linked lists are suitable for which of the following problems?

Correct : B. Binary search

58. Identify the data structure which allows deletions at both ends of the list but insertion at only one end___________.

Correct : A. Input-restricted dequeue.

59. Which of the following data structure is non-linear type?

Correct : D. Hierarchical.

60. To represent hierarchical relationship between elements, which data structure is suitable?

Correct : C. Tree.

61. When does the ArrayIndexOutOfBoundsException occur?

Correct : B. Run-time

62. The depth of a complete binary tree is given by__________.

Correct : D. Dn = log2n+1.

63. When converting binary tree into extended binary tree, all the original nodes in binary tree are___________.

Correct : A. internal nodes on extended tree.

64. Which of the following conditions checks available free space in avail list?

Correct : C. Avail=Null

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

Correct : C. Quick sort.

66. STACK is also called as ______________.

Correct : B. LIFO

67. Collection of related data items is called _______.

Correct : D. records.

68. Breadth First search is used in____________.

Correct : C. graphs.

69. A variable whose size is determined at compile time and cannot be changed at run time is_________.

Correct : A. static variable.

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

Correct : B. Push

71. Length of linear array can be found by using the formula_________

Correct : A. UB-LB+1

72. The average number of key comparisons done in a successful sequential search in a list of length n is___________.

Correct : D. n+1/2.

73. A technique for direct search is _______________.

Correct : D. Hashing

74. Base address is the address of __________.

Correct : A. first element

75. A _____________ list is a list where the last node contains null pointer.

Correct : B. grounded header.

76. ___________are used to facilitate the processing of information in an array.

Correct : A. Pointers.

77. The comparison tree is also called as________.

Correct : A. decision tree.

78. A linked list whose last node points back to the list node instead of containing the null pointer________.

Correct : A. circular list.

79. __________________ is a header list where the last node contains the null pointer.

Correct : B. Grounded Header Linked list

80. Which of the following case does not exist in complexity theory

Correct : D. Null case

81. The _________ for a linked list is a pointer variable that locates the beginning of the list.

Correct : D. header.

82. The time factor when determining the efficiency of algorithm is measured by____________.

Correct : B. counting the number of key operations.

83. The space factor when determining the efficiency of algorithm is measured by___________.

Correct : A. counting the maximum memory needed by the algorithm.

84. The Worst case occur in linear search algorithm when_____________.

Correct : D. item is the last element in the array or is not there at all.

85. The complexity of linear search algorithm is____________.

Correct : B. O(n).

86. The time required in best case for search operation in binary tree is ____________.

Correct : C. O(log n).

87. Which of the following way follows in Post order traversal?

Correct : D. Left sub tree -> Right sub tree -> Root.

88. A _________is a linked list which always contains a special node called the header node, at the beginning of the list.

Correct : C. Header Linked List.

89. _______________is a header list where the last node points back to the header node.

Correct : D. Circular Header List.

90. The advantage of a two-way list and a circular header list is combined into a ________.

Correct : A. two-way circular header list.

91. The pointer of the last node contains a special value called_____________.

Correct : B. index pointer.

92. The OS of a computer may periodically collect all the deleted space onto the free storage list. This technique is called______________.

Correct : B. garbage collection.

93. Important part of any compiler is the construction and maintenances of a dictionary, this types of dictionary are called______________.

Correct : A. symbol table.

94. The data structure required to check whether an expression contains balanced parenthesis is?

Correct : B. stack

95. What are the advantages of arrays?

Correct : D. All of the mentioned

96. The number of possible ordered trees with three nodes A,B,C is?

Correct : B. 12.

97. The earliest use of__________ sorting was in conjunction with network analysis.

Correct : A. topological.

98. _________is not the operation that can be performed on Queue.

Correct : A. Traversal.

99. A tree is a finite set of_________.

Correct : D. nodes.

100. Stack can be represented by means of ____________.

Correct : C. One-way List.