Analysis of algorithms viva questions / Interview questions - set1 /sorting algorithms
Top 10 Questions on Sorting Algorithms and Divide and Conquer Approach Top 10 Questions on Sorting Algorithms and Divide and Conquer Approach Understanding basic sorting algorithms and the divide and conquer approach is crucial for every computer science student. Below are the most frequently asked questions with answers from Module 1: Introduction to Algorithms . 1. What is Selection Sort and how does it work? Selection Sort is a comparison-based algorithm that divides the array into a sorted and unsorted part. It repeatedly selects the minimum element from the unsorted section and moves it to the beginning. Time Complexity: O(n²) Stable: No In-place: Yes 2. What are the steps involved in Insertion Sort? Insertion Sort builds the sorted array one element at a time by inserting each new element into its correct position among the previously sorted elements. Best Case: O(n) Worst Case: O(n²) Stable: Ye...
Comments
Post a Comment