Analysis of Algorithms and Computational Complexity Questions and Answers

Practice Mode
Showing 10 of 239 questions
Q31
Using the standard algorithm, what is the time required to determine that a number n is prime?
  • A linear time
  • B logarithmic time
  • C constant time
  • D quadratic time
Answer: Option A
Q32
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)
  • A 15
  • B 20
  • C 50
  • D 100
Answer: Option C
Q33
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
  • A 1267
  • B 1164
  • C 1264
  • D 1169
Answer: Option C
Q34
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
  • A Sum : = N + Sum (N)
  • B Sum : = N + Sum (N - 1)
  • C Sum : = (N - 1) + Sum (N)
  • D Sum : = (N - 1) + Sum (N - 1)
Answer: Option B
Q35
A search technique where we keep expanding nodes with least occumulated cost so far is called
  • A Hill - climbing
  • B Branch - and - bound
  • C Best - first
  • D Divide - and conquer
Answer: Option B
Q36
Which of the following sort algorithm operates in quadratic time relative to the number of elements in the array (on the average) ?
  • A quick sort
  • B heap sort
  • C bubble sort
  • D radix sort
Answer: Option C
Q37
What is true for the complete bipartite graphs K(3, 3) and K(2, 4) ?
  • A Bothe are planar
  • B Neither eis planar
  • C Both are isomorphic
  • D None of these
Answer: Option D
Q38
Queues serve a major role in
  • A simulation of recursion
  • B simulation of arbitrary linked list
  • C simulation of limited resource allocation
  • D expression evaluation
Answer: Option C
Q39
The number of nodes in a complete binary tree of level 5 is
  • A 15
  • B 25
  • C 63
  • D 71
Answer: Option C
Q40
The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is
  • A conceptually easier and completely dynamic
  • B efficient if the spares matrix is a band matrix
  • C efficient in accessing an entry
  • D all of these
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test