Algorithm Viva Questions and Answers Algorithm Viva Questions and Detailed Answers 2. Divide and Conquer Approach Q1. What is the Divide and Conquer strategy? It is an algorithmic paradigm that breaks a problem into subproblems, solves them recursively, and then combines their results. Examples include Merge Sort, Quick Sort, and Binary Search. Q2. Explain Finding Minimum and Maximum using Divide and Conquer. The array is split into halves. Recursively, min and max of each half are found, and finally the overall min and max are determined using a comparison of results from the halves. Q3. Describe Merge Sort. Merge Sort divides the list into halves, recursively sorts them, and merges the sorted halves. It has a time complexity of O(n log n) and is stable but not in-place. Q4. Explain Quick Sort. Quick Sort selects a pivot, partitions the array such that elements lesser are on the left and greater on the right, then recursively sort...
Comments
Post a Comment