Analysis of Algorithms and Computational Complexity

Analysis of Algorithms and Computational Complexity
31. Using the standard algorithm, what is the time required to determine that a number n is prime?
  • linear time
  • logarithmic time
  • constant time
  • quadratic time
Show Answer
32. How many real links are required to store a sparse matrix of 10 rows, 10 columns, and 15 non-zero entries, (Pick up the closest answer)
  • 15
  • 20
  • 50
  • 100
Show Answer
33. A one dimensional array A has indices 1....75. Each element is a string and takes up three memory works. the array is stored starting at location 1120 decimal. The starting address of A[49] is
  • 1267
  • 1164
  • 1264
  • 1169
Show Answer
34. Following is a recursive function for computing the sum of integers from 0 to N function sum (N : integer) :integer begin if N = 0 then Sum = 0 elese The missing line in the else part is
  • Sum : = N + Sum (N)
  • Sum : = N + Sum (N - 1)
  • Sum : = (N - 1) + Sum (N)
  • Sum : = (N - 1) + Sum (N - 1)
Show Answer
35. A search technique where we keep expanding nodes with least occumulated cost so far is called
  • Hill - climbing
  • Branch - and - bound
  • Best - first
  • Divide - and conquer
Show Answer
36. Which of the following sort algorithm operates in quadratic time relative to the number of elements in the array (on the average) ?
  • quick sort
  • heap sort
  • bubble sort
  • radix sort
Show Answer
37. What is true for the complete bipartite graphs K(3, 3) and K(2, 4) ?
  • Bothe are planar
  • Neither eis planar
  • Both are isomorphic
  • None of these
Show Answer
38. Queues serve a major role in
  • simulation of recursion
  • simulation of arbitrary linked list
  • simulation of limited resource allocation
  • expression evaluation
Show Answer
39. The number of nodes in a complete binary tree of level 5 is
  • 15
  • 25
  • 63
  • 71
Show Answer
40. The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is
  • conceptually easier and completely dynamic
  • efficient if the spares matrix is a band matrix
  • efficient in accessing an entry
  • all of these
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test