Analysis of Algorithms and Computational Complexity Questions and Answers

Take Exam

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

Showing 10 of 239 questions

141. Which of the following lines of code will delete two successive nodes of a singly linked linear list (WITH MORE THAN 2 NODES) ? Assume this code is in the main program, not a subprocedure

  • LINK[X]:=LINK [LINK[X]];
  • X : = LINK [LINK [X];
  • LINK [LINK [X]] : = X;
  • LINK [X]: = LINK [LINK [LINK[X]]]
Show Answer Report

142. If memory for the run-time stack is only 150 cells (words), how big can N be in Factorial (N) before encountring stack overflow?

  • 24
  • 15
  • 66
  • 50
Show Answer Report

143. How many comparisons are required to sort an array of length 5 if a straight selection sort is used and the array is already sorted in the opposite order ?

  • 0
  • 1
  • 15
  • 20
Show Answer Report

144. With round-robin CPU scheduling in a time-shared system

  • using very large time slices (quantas) degenerates into FCFS (First-Come First-Served) algorithm
  • Using very small time slices (quantas) degenerates into LIFO (last-In First-Out) algorithm
  • using extremely small time slice improves performance
  • using medium sized time slice leads to SRTF (Shortest Remaining Time First) scheduling policy
Show Answer Report

145. Sorting data means to arrange it in ------order

  • alphabetical
  • numerical
  • either alphabetical or numerical
  • none of these
Show Answer Report

146. Data sorted from the largest value to the smallest value is sorted in

  • ascending
  • descending
  • randomly
  • none of these
Show Answer Report

147. If the binary search algorithm determines that the search argument is in the upper half of the array, which of the following statements will set the appropriate variable to the appropriate value?

  • start Sub = middle Sub - 1;
  • start Sub = middle Sub + 1;
  • stop Sub = middle Sub - 1;
  • stop Sub = middle Sub + 1;
Show Answer Report

148. Which of the following statements is used in the binary search algorithm to halve the array ?

  • middle Sub = (start Sub + stop Sub)/2
  • middle Sub = sdtart Sub + stop Sub/2
  • middle Sub = middle Sub/2;
  • middle Sub = (stop Sub - start Sub)/2
Show Answer Report

149. The _____ algorithm works by comparing adjacent array that are out of order.

  • alphabetic
  • bubble
  • compare
  • list
Show Answer Report

150. When you use the bubble sort, the first step in swapping two of the elements in the salary array is to

  • assign salary [X] to temp
  • assign salary [X+2] to temp
  • assign salary [X] to salary [X+1]
  • assign temp to salary [X]
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test