Analysis of Algorithms and Computational Complexity Questions and Answers
Understanding the Analysis of Algorithms and Computational Complexity questions with answers is crucial for students preparing for GATE, TCS, Infosys, and Wipro placement exams. This topic focuses on evaluating the efficiency of algorithms based on time and space complexity, which forms the foundation of advanced computer programming and system design. By solving programming questions and answers related to algorithm analysis, you can strengthen your logical thinking, optimize code performance, and make informed design decisions. In this section, we cover detailed MCQs and explanations to help you master Big O notation, asymptotic analysis, and algorithmic trade-offs. Perfect for both academic and placement preparation, this guide ensures clarity with well-explained examples.
Questions on algorithmic analysis for computer science aspirants can be complemented by data structure algorithms and software engineering MCQ
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
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
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
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)
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
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
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
38. Queues serve a major role in
- simulation of recursion
- simulation of arbitrary linked list
- simulation of limited resource allocation
- expression evaluation
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