Data Structure and Algorithms (Set 1)
Data Structure and Algorithms (Set 1)
1 of 4 sets
6. To find the predecessor, it is required to traverse the list from the first node in
case of singly linked list.
A. i-only
B. ii-only
C. both i and ii
D. none of both
Answer:C
7. Nodes that are not root and not leaf are called as internal nodes.
A. true, true
B. true, false
C. false, true
D. false, false
Answer:C
13. Which of the following case does not exist in complexity theory
A. best case
B. worst case
C. average case
D. null case
Answer:D
14. The space factor when determining the efficiency of algorithm is measured by
A. counting the maximum memory needed by the algorithm
B. counting the minimum memory needed by the algorithm
C. counting the average memory needed by the algorithm
D. counting the maximum disk space needed by the algorithm
Answer:A
15. The time factor when determining the efficiency of algorithm is measured by
A. counting microseconds
17. Computers are used for processing numerical data called _______ data.
A. float
B. local
C. character
D. non-local
Answer:C
18. Each programming language contains a ______ set that is used to communicate
with the computer.
A. character
B. integer
C. float
D. numeric
Answer:A
21. A computer which can access an individual byte is called a ________ machine.
A. memory addressable
B. byte addressable
C. bit
D. byte
Answer:B
24. _________ operation of word processing involves replacing one string in the
text by another.
A. insertion
B. deletion
C. searching
D. replacement
Answer:D
27. Each node in a linear list contains an item called _______ which points to the
next node in the list.
A. node
B. link
C. variable
D. null
Answer:B
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.
A. dynamic
B. static
C. semi static
D. global
Answer:C
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.
A. fixed length
B. linked list
30. If string 1 = John, and string 2 = Rivers are merged, the process is called ----
A. insertion
B. deletion
C. concatenation
D. replacement
Answer:C
31. _____ is a variable whose length may vary during the execution of a program.
A. dynamic
B. static
C. semi static
D. global
Answer:A
34. The number of elements n is called the length or _____ of the array.
A. upper bound
B. lower bound
36. Which of the following items are not part of the array declaration?
A. name of the array
B. data type of the array
C. index set of the array
D. length of the array
Answer:D
37. Programming languages like FORTRAN and PASCAL allocate memory space
for arrays ______.
A. dynamically
B. statically
C. successively
D. alternatively
Answer:B
38. The process of accessing and processing each element of an array A, exactly
once is called _______.
A. deleting
B. inserting
C. traversing
D. searching
Answer:C
41. ________ is a list in which the order of the items is significant, and the items are
not necessarily sorted.
A. ordered list
B. indexed list
C. sequential list
D. unordered list
Answer:C
42. Representation of a two dimensional as one single column of rows and mapping
it sequentially is called _______ representation.
A. row-major
B. row
C. column-major
D. column
Answer:A
43. Matrices with relatively high proportion of zero entries are called ______
matrices.
A. triangular
B. diagonal
C. sparse
D. adjacency
Answer:C
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.
A. triangular
B. tridiagonal
C. sparse
D. simple
Answer:C
48. Array is a
A. index data structure
B. non liturenear data structure
C. complx data structure
D. none of the above
49. Row -major order in two -dimentional array refers to an arrangement where
A. all elements of a row are stored in memory in sequence followed by next row in sequence,and
so on
B. all elements of row are stored in memory in sequence followed by next column in sequence
,and so on
C. all elements of row are stored in memory in sequence followed by next column in sequence
D. none of the above
Answer:A
50. Array is
A. data in physical order
B. data in logical order
C. both a& b
D. none of the above
Answer:A
52. let x be the adjacency matrix of a graph .G with no self loop.The entries along
the principle diagonal of x are
A. all "0"
B. all "1"
C. both 0&1
D. different
Answer:A
53. _______ refers to the operation of finding the location of a given item in a
collection of items.
A. sorting
54. _______ is a field whose values uniquely determine the records in the file.
A. pointer
B. primary key
C. secondary key
D. function
Answer:B
58. _________ is a search for data that uses an index to locate the item.
A. binary search
59. If the input array is unsorted, then only a linear ______ can be used.
A. binary search
B. sequential search
C. indexed search
D. jump search
Answer:B
60. _______ is a attribute of a sort, indicating that data with equal keys maintain
their relative input order in the output.
A. sort order
B. sort stability
C. sort efficiency
D. collision
Answer:B
61. In ______ method of hashing, selected digit are extracted from the key and used
as the address.
A. subtraction
B. digit extraction
C. rotation
D. folding
Answer:B
63. If two different keys yield the same hash address, it is called _______ .
65. A ______ merge sort uses a constant number of input merge files and the same
number of output merge files.
A. k-way
B. balanced
C. polyphase
D. radix
Answer:B
67. _______ is a merge sort that sorts a data stream using repeated merges.
A. balanced
B. polyphase
C. radix
D. k-way
Answer:D
72. Best and the worst case timing complexities of insertion sort are_________.
A. o(n2), o(n2)
B. o(n log n), o(n2)
C. o(n), o(n2)
D. o(n), o(n3)
Answer:C
80. If s1 is "ABC" and s2 is "DEF" then strcat(s1,s2)will give the following result.
A. s1="abcdef" and s2="def"
B. s1="abcdef" and s2="def"
C. s1="abc" and s2="abcdef"
D. s1="abc" and s2="abcdef"
Answer:A
84. Which of the following data structure store the homogeneous data elements?
A. arrays
B. records
C. pointers
D. none
Answer:B
88. A sorted file contains 16 items. Using binary search, the maximum number of
comparisons to search for an item in this file is
A. 15
B. 8
C. 1
D. 4
Answer:D
89. A sort which compares adjacent elements in a list and switches where necessary
is
A. insertion sort
B. heap sort
C. quick sort
D. bubble sort
Answer:D
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
A. insertion sort
B. selection sort
C. heap sort
D. quick sort
Answer:B
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
A. 11
B. 12
C. 13
D. 14
Answer:D
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
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?
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:C
94. Which of the following sorting methods will be the best if number of swappings
done, is the only measure of efficienty?
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:B
95. You are asked to sort 15 randomly generated numbers. You should prefer
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:A
96. What is the number of swaps required to sort n elements using selection sort, in
the worst case?
A. ?(n)
B. ?(n log n)
C. ?(n2)
D. ?(n2 log n)
Answer:A
99. Which of the following sorting methods would be most suitable for sorting a list
which is almost sorted
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:A