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
221. Sparse matrices have
- many zero entries
- many non-zero entries
- higher dimension
- none of these
222. In which of the following cases, linked list implementation of sparse matrices consumes the same memory space as the conventional way. of storing the entire array ?
- 5 * 6 matrix with 9 non-zero entries
- 5 * 6 matrix with 8 non-zero entries
- efficient in accessing an entry
- efficient if the sparse matrix is a band matrix
223. The average search time of hashing, with linear probing will be less if the load factor
- is far less than one
- equals one
- is far greater than one
- none of these
224. A hash table can store a maximum of 10 records. Currently there are records inn location 1, 3, 4, 7, 8, 9, 10. The probability of a new record going into location 2, with a hash function resolving collisions by linear probing is
- 0.6
- 0.1
- 0.2
- 0.5
225. Consider a hashing function that resolves collision by quadratic probing. Assume the address space is indexed fron 1 to 8. If a collision occurs at position 4, then the location which will never be probed is
- 4
- 5
- 8
- 2
226. A hash table has space for 100 records. then the probability of collision before the table is 10% full, is
- 0.45
- 0.5
- 0.3
- 0.34 (approximately)
227. Trie Indexing
- is efficient in dealing with strings of variables length
- has the number of disk accesses can't exceed the length of the particular string that is searched
- can handle insertions and deletions, dynamically and efficiently
- all of these
228. Stacks can't be used to
- evaluate an arithmetic expression in postfix
- implement recursion
- convert a given arithmetic expression in infix form to its equivalent postfix form
- allocate resources (like CPU) by the operating system
229. The way a card game player arranges his cards as he picks them up one by one, is an example of
- bubble sort
- selection sort
- insertion sort
- merge sort
230. The average number of comparison performed by the merge sort algorithm, in merging two sorted lists of length 2 is
- 8/3
- 8/5
- 11/7
- 11/6