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
181. Traversing a binary tree first root and then left and right subtrees called ____ traversal.
- postorder
- preorder
- inorder
- none of these
182. Identify the true statements regarding insertion of node in a linear linked list. I. Setting the field of the new node means allocating memory to newly created node II. If the node precedes all others in the list, then insert it at the front and return its address III. Creating a new node depends upon free memory space IV. The node number where insertion to be taken place, must be known prior to the insertion.
- (i), (ii) and (iii)
- (ii), (iii), and (iv)
- (i) and (ii)
- (ii) and (iii)
183. Which of the following statements are true about a doubly linked list ? I. it may be either linear or circular II. it must contain a header node III. it will occupy same memory space as that of linear linked list, both having same number of nodes
- only (i)
- (ii) and (iii)
- (i), (ii) and (iii)
- (i) and (iii)
184. Identity the steps to be taken when a first node is to be deleted from linear linked list. I. Set link of start pointer to the second node in the list II. Free the space associated with first node III. Obtain the address of the second node in the list III. Obtain the address of the second node in the list IV. Count the number of nodes in the list
- (i) and (ii)
- (i), (ii) and (iii)
- (ii) and (iii)
- (i), (ii), (iii), and (iv)
185. What can be said about the array representation of a circular queue when it contains only one element ?
- front = rear = Null
- front = Rear + 1
- front = Rear -1
- front = rear = Null
186. Which of the following statements are correct ? I. If each tree node contains a father field, then it's not necessary to use either stack or threads II. Traversal using father pointers is more time efficient than traversal of a threaded tree III. a in-thread binary tree is defined as binary tree that is both left-in threaded and right-in threaded.
- (i),(ii) and (iii)
- (i) and (iii)
- (ii) and (iii)
- none of these
187. To sort many large object or structures, it would be most efficient to
- place reference to them in and array an sort the array
- place them in a linked list and sort the linked list
- place pointers to them in an array and sort the array
- place them in an array and sort the array
188. In a linked list
- (a) each link contains a pointer tto the next link
- an array of pointers point to the links
- each link contains data or pointer to data
- the links are stored in an array
189. If you want to sort many large objects or structures, it would be most efficient to place
- them in an array and sort the array
- pointers to them in an array and sort the array
- them in a linked list and sort the linked list
- references to them in an array and sort the array
190. Running out of memory may occur due to
- non-recursive functrion call
- recursive function call
- use of more global variable
- none of these