The complexity of Binary search algorithm is _Įxplanation: The complexity of the binary search is O(logn).ġ4. The complexity of linear search algorithm is _Įxplanation: The worst-case complexity of the linear search is O(n).ġ3. Which of the following case does not exist in complexity theory?Įxplanation: Null case does not exist in complexity theory.ġ2. Start your Programming Journey with Python Programming which is Easy to Learn and Highly in Demandġ1. There are two algorithms suppose A takes 1.41 milliseconds while B takes 0.9 milliseconds, which one of them is better considering all other things the same?Įxplanation: B takes less time than A for the same task. An algorithm: can be represented through _Įxplanation: Algorithm is represented through pseudo codes, normal language sentences or flow charts.ġ0. For an algorithm which is the most important characteristic that makes it acceptable _Įxplanation: An algorithm should be correct otherwise it’s of no use even if it is fast and compact.ĩ. Optimization of algorithm means _Ī) making that algorithm fast by time and compact by spaceī) making that algorithm slow by time and large by spaceĬ) making that algorithm fast by time and large by spaceĭ) making that algorithm slow by time and compact by spaceĮxplanation: An Algorithm should be fast and compact.Ĩ. Prepare for Aptitude with 50+ Videos Lectures and Handmade NotesĪ) a base case is necessary and is solved without recursion.Įxplanation: Base case ends recursion and therefore it is necessary for finite recursion.ħ. An algorithm which tries all the possibilities unless results are satisfactory is and generally is time-consuming is _Įxplanation: In Brute force, all the possibilities are tried. A Complexity of algorithm depends upon _Įxplanation: For Complexity, we calculate both time and space consumed.ĥ. An algorithm which uses the past results and uses them to find the new results is _Įxplanation: In Dynamic programming algorithms we utilize previous results for new ones.Ĥ. An algorithm in which we divide the problem into subproblem and then we combine the subsolutions to form solution to the original problem is known as _Įxplanation: In Divide and Conquer we divide the problem and then recombine the solution.ģ. Explanation: An algorithm is a stepwise solution to the problem.Ģ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |