Data Structure Important Questions and Answers Set - 2
28. Which of the following data structure is linear data structure ?
A. Trees
B. Graphs
C. Arrays
D. None of the above
Ans - C. Arrays
29. The operation of processing each element in the list is known as
A. Merging
B. Inserting
C. Traversal
D. All of the above
Ans - C. Traversal
30. Finding the location of the element with a given value is called
A. Traversal
B. Search
C. Sort
D. All of the above
Ans- B. Search
31. Arrays are best data structures for
A. Relatively permanent collections of data
B. The size of the structure and the data in the structure are constantly changing
C. Both of above situation
D. None of above situation
Ans- A . Relatively permanent collections of data
32. Linked lists are best suited for
A. Relatively permanent collections of data
B. The size of the structure and the data in the structure are constantly
changing
C. Both of above situation
D.None of above situation
Ans - B. The size of the structure and the data in the structure are constantly changing
33. Each array declaration need not give , implicitly or explicitly , the information about the
A. Name of array
B. Data type of array
C. First data from the set to be stored
D. Index set of the array
Ans- C. First data from the set to be stored
34. The complexity of merge sort algorithm is
A. O (n)
B. O(log n )
C.O (n log n )
D. None of the above
Ans- C. O (n log n )
35. The indirect change of the values of a variable in one module by another
module is called
A. Internal change
B. Inter - module change
C. Side effect
D. All of the above
Ans- C. Side effect
36. Two main measures for the efficiency of an algorithm are
A. Time and space
B. Processor and memory
C. Complexity and capacity
D. Data and space
Ans - A. Time and space
37. The time factor when determining the efficiency of algorithm is measured
by
A. Counting the number of key operations
B. Counting the number of statements
C. Counting the kilobytes of algorithm
D. None of the above
Ans - A. Counting the number of key operations
38. 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
Ans - A. Counting the maximum memory needed by the algorithm
39. All the above * which of the following data structures are indexed structures
A. Linear arrays
B. Linked lists
C. Both of above
D. None of the above
Ans - A. Linear arrays
40. Which of the following is not the required condition for binary search
algorithm
A. There must be mechanism to delete and / or insert elements in list
B. The list must be sorted
C. There should be the direct access to the middle element in any sublist
D. None of the above
Ans- A. There must be mechanism to delete and / or insert elements in
list
41. Which of the following is not a limitation of binary search algorithm ?
A. Binary search algorithm is not efficient when the data elements are more
than 1000
B. Must use a sorted array
C. Requirement of sorted array is expensive when a lot of insertion and
deletion are needed
D. There must be a mechanism to access middle element directly
Ans- A. Binary search algorithm is not efficient when the data elements
are more than 1000
42. Two dimensional arrays are also called
A. Table arrays
B. Matrix arrays
C. Both of the above
D. None of the above
Ans- C. Both of the above
43. The term “push” and “pop” is related to the
A. Array
B. Lists
C. Stacks
D. All of the above
Ans - C. Stacks
44. A data structure where elements can be added or removed at either end but not in the middle is referred as
A. Linked lists
B. Stacks
C. Queues
D. Deque
Ans - D. Deque
45. The following sorting algorithm is of divide - and - conquer type
A. Bubble sort
B. Insertion sort
C. Quick sort
D. None of the above
Ans - B . Insertion sort
46. An algorithm that calls itself directly or indirectly is known as
A. Recursion
B. Polish notation
C. Traversal algorithm
D. None of the above
Ans- A. Recursion
47. The elements of an array are stored successively in memory cells
because
A. By this way computer can keep track only the address of the first element
and the addresses of other elements can be calculated
B. The architecture of computer memory does not allow arrays to store other
than serially
C. A and B both false
D. A and B both true
Ans - A. By this way computer can keep track only the address of the
first element and the addresses of other elements can be calculated
48. The memory address of the first element of an array is called
A. Base address
B. Floor address
C. Foundation address
D. First address
Ans- A. Base address
49. The memory address of fifth element of an array can be calculated by the
formula
A. LOC ( Array[5] = Base ( Array [5] + ( 5 - lower boun (D) , where w is the
number of words per memory cell for the array
B. LOC ( Array[5] = Base ( Array [4] + ( 5 - Upper boun (D) , where w is the
number of words per memory cell for the array
C. LOC ( Array[5] = Base ( Array ) + w ( 5 - lower boun (D) , where w is the
number of words per memory cell for the array
D. None of the above
Ans- C. LOC ( Array[5] = Base ( Array ) + w ( 5 - lower boun (D) , where w
is the number of words per memory cell for the array
50. The following data structure can’t store the non - homogeneous data elements
A. Arrays
B. Records
C. Pointers
None of the above
Ans - A. Arrays
51. The in order traversal of tree will yield a sorted listing if elements of tree in
A. Binary trees
B. Binary search trees
C. Heaps
D. None of the above
Ans - B. Binary search trees
52. In a heap tree values in a node is greater than
A. Every value in left sub tree and smaller than right sub tree
B. Every value in children of it
C. Both of above conditions are true
D. None of the above conditions are true
Ans - B. Every value in children of it
53. In a graph e = [ u,v] then u and v are called
A. Endpoints of e
B. Adjacent nodes
C. Neighbors
D. All of the above
Ans - D. All of the above
54. A connected graph T without any cycles is called
A. Tree graph
B. Free tree
C. Tree
D. All of the above
Ans - D. All of the above
55. The difference between linear array and a record is
A. An array is suitable for homogeneous data but the data items in a record
may have different data type
B. In a record , there may not be a natural ordering in opposed to linear array
C. A record form a hierarchical structure but a linear array does not
D. All of the above
Ans - D. All of the above
56. The following data structure store the homogeneous data elements
A. Arrays
B. Records
C. Pointers
D. None of the above
Ans - B. Records
57. Which of the following data structure is not linear data structure ?
A. Arrays
B. Linked lists
C. A and B are true
D. None is true
Ans - C . A and B are true