Quiznetik

Data Structure and Algorithms (DSA) | Set 1

1. It exports a set of operations

Correct : C. true, true

2. A graph is said to be complete if there is no edge between every pair of vertices.

Correct : B. true, true, false

3. Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.

Correct : C. a-iii, b-i, c-ii

4. The time complexity of binary search is O(logn).

Correct : D. true, true

5. A graph is said to be complete if there is an edge between every pair of vertices.

Correct : A. true, true

6. To find the predecessor, it is required to traverse the list from the first node in case of singly linked list.

Correct : C. both i and ii

7. Nodes that are not root and not leaf are called as internal nodes.

Correct : C. false, true

8. A node is child node if out degree is one.

Correct : B. true, false

9. Insertion b) Deletion c) Retrieval d) Traversal

Correct : D. none of the above

10. In strictly binary tree, the out-degree of every node is either o or 2.

Correct : C. true, true

11. The complexity of the average case of an algorithm is

Correct : A. much more complicated to analyze than that of worst case

12. The Average case occur in linear search algorithm

Correct : A. when item is somewhere in the middle of the array

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

Correct : D. null case

14. The space factor when determining the efficiency of algorithm is measured by

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

15. The time factor when determining the efficiency of algorithm is measured by

Correct : B. counting the number of key operations

16. Two main measures for the efficiency of an algorithm are

Correct : C. time and space

17. Computers are used for processing numerical data called _______ data.

Correct : C. character

18. Each programming language contains a ______ set that is used to communicate with the computer.

Correct : A. character

19. Finite sequence S of zero or more characters is called _______.

Correct : C. string

20. String with zero characters is called ________ string.

Correct : A. null

21. A computer which can access an individual byte is called a ________ machine.

Correct : B. byte addressable

22. Groups of consecutive elements in a string, such as words, phrases and sentences are called ________.

Correct : B. substring

23. The number of characters in a string is called its ______.

Correct : C. width

24. _________ operation of word processing involves replacing one string in the text by another.

Correct : D. replacement

25. ________ is the problem of deciding whether or not a given String pattern P appears in a text T.

Correct : A. pattern matching

26. ________ is a linearly ordered sequence of memory cells.

Correct : A. node

27. Each node in a linear list contains an item called _______ which points to the next node in the list.

Correct : B. link

28. _______ is a variable whose length may vary during the execution, but the length cannot exceed a maximum values defined before the program is executed.

Correct : C. semi static

29. In _______ storage, each cell is divided into two parts---- the path stores a single character, while the second part contains the address of the cell containing the next character.

Correct : B. linked list

30. If string 1 = John, and string 2 = Rivers are merged, the process is called ----

Correct : C. concatenation

31. _____ is a variable whose length may vary during the execution of a program.

Correct : A. dynamic

32. _______ is a structure used to represent the linear relationship between elements by means of sequential memory locations.

Correct : B. array

33. A ______ is a list of a finite number of homogeneous data elements.

Correct : A. linear array

34. The number of elements n is called the length or _____ of the array.

Correct : C. size

35. The number K in A[K] is called the subscript or the ________.

Correct : B. index

36. Which of the following items are not part of the array declaration?

Correct : D. length of the array

37. Programming languages like FORTRAN and PASCAL allocate memory space for arrays ______.

Correct : B. statically

38. The process of accessing and processing each element of an array A, exactly once is called _______.

Correct : C. traversing

39. _________ refers to the operations of rearranging the elements of an array A so that they are in increasing order.

Correct : B. sorting

40. Two dimensional arrays are sometimes called _______ arrays.

Correct : C. matrix

41. ________ is a list in which the order of the items is significant, and the items are not necessarily sorted.

Correct : C. sequential list

42. Representation of a two dimensional as one single column of rows and mapping it sequentially is called _______ representation.

Correct : A. row-major

43. Matrices with relatively high proportion of zero entries are called ______ matrices.

Correct : C. sparse

44. _______ arrays are where the elements in the different arrays with the same subscript belongs to the same record.

Correct : B. parallel

45. Records can be stored in an area of memory called _______ memory.

Correct : A. dynamic

46. A matrix in which non-zero entries can only occur on the diagonal or on elements immediately above or below the diagonal, is called ______ matrix.

Correct : C. sparse

47. Elements of of an arrays are accessed by

Correct : C. index

48. Array is a

Correct : D. none of the above

49. Row -major order in two -dimentional array refers to an arrangement where

Correct : A. all elements of a row are stored in memory in sequence followed by next row in sequence,and so on

50. Array is

Correct : A. data in physical order

51. how many vlue can held by an array A(-1…m,1…m)?

Correct : D. m(m+2)

52. let x be the adjacency matrix of a graph .G with no self loop.The entries along the principle diagonal of x are

Correct : A. all "0"

53. _______ refers to the operation of finding the location of a given item in a collection of items.

Correct : B. searching

54. _______ is a field whose values uniquely determine the records in the file.

Correct : B. primary key

55. By using which of the following methods sorting is not possible?

Correct : D. deletion

56. Which is the simplest file structure?

Correct : A. sequential

57. A ______ is a data structure use foe a storage of a records.

Correct : B. hash table

58. _________ is a search for data that uses an index to locate the item.

Correct : C. indexed search

59. If the input array is unsorted, then only a linear ______ can be used.

Correct : B. sequential search

60. _______ is a attribute of a sort, indicating that data with equal keys maintain their relative input order in the output.

Correct : B. sort stability

61. In ______ method of hashing, selected digit are extracted from the key and used as the address.

Correct : B. digit extraction

62. ________ hashing method is used in combination with other methods.

Correct : C. rotation

63. If two different keys yield the same hash address, it is called _______ .

Correct : C. collision

64. The ______ sort algorithm is called diminishing increment sort.

Correct : C. shell

65. A ______ merge sort uses a constant number of input merge files and the same number of output merge files.

Correct : B. balanced

66. ________ method of collision resolution involves maintaining two tables in memory.

Correct : B. chaining

67. _______ is a merge sort that sorts a data stream using repeated merges.

Correct : D. k-way

68. One of the statement is false

Correct : C. typedef is derived data type

69. Examples of sorting algorithms are

Correct : D. (a),(b),and ©

70. Give timing complexities of three sorting algorithms bubble sort,selection sort,insertion sort respectively.

Correct : B. o(n2), o(n2), o(n2)

71. _____passes are required to sort n data using bubble sort.

Correct : B. n-1

72. Best and the worst case timing complexities of insertion sort are_________.

Correct : C. o(n), o(n2)

73. Which sorting algorithm can exploit the partially sorted data in a list?

Correct : C. insertion sort

74. Sorting is useful for_________

Correct : C. making searching easier and efficient

75. The getch() library function returns___

Correct : A. a character when any key is pressed

76. The function islower(char)checks whether a character is in lower case or not.Therefore it should return______

Correct : A. 0 or 1

77. A variable P is called pointer if__

Correct : A. p contains the address of an element in data

78. Which of the following data structure can't store the non-homogeneous data element?

Correct : A. arrays

79. The difference between linear array and a record is_____

Correct : D. all of above

80. If s1 is "ABC" and s2 is "DEF" then strcat(s1,s2)will give the following result.

Correct : A. s1="abcdef" and s2="def"

81. Give output of the following programint main(){inta[]={2,3,4,5,6};printf("%d",2[a]);}

Correct : C. 4

82. Where do we use the operator --> ?

Correct : D. both(a) and(b).

83. The function strcmp(s1,s2)will return -1 if____

Correct : C. s1<s2

84. Which of the following data structure store the homogeneous data elements?

Correct : B. records

85. The number of comparisons required to sort 5 numbers in ascending order using bubble sort are

Correct : C. 10

86. A sorting algorithm is stable if

Correct : B. preserves the original order of records with equal keys

87. The average case complexity of Insertion Sort is

Correct : C. o(n2)

88. A sorted file contains 16 items. Using binary search, the maximum number of comparisons to search for an item in this file is

Correct : D. 4

89. A sort which compares adjacent elements in a list and switches where necessary is

Correct : D. bubble sort

90. A sort which iteratively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called

Correct : B. selection sort

91. The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order, using bubble sort is

Correct : D. 14

92. A sorting technique that guarantees that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be

Correct : A. stable

93. You want to check whether a given set of items is sorted. Which of the following sorting methods will be most efficient if it is already in sorted order?

Correct : C. insertion sort

94. Which of the following sorting methods will be the best if number of swappings done, is the only measure of efficienty?

Correct : B. selection sort

95. You are asked to sort 15 randomly generated numbers. You should prefer

Correct : A. bubble sort

96. What is the number of swaps required to sort n elements using selection sort, in the worst case?

Correct : A. Θ(n)

97. The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is

Correct : B. 5

98. The smallest element of an array’s index is called its

Correct : A. lower bound

99. Which of the following sorting methods would be most suitable for sorting a list which is almost sorted

Correct : A. bubble sort

100. The complexity of Bubble sort algorithm is

Correct : C. o(n2)