Easy Algorithms Sorting Algorithms
Explain selection sort and its characteristics.
Answer
Selection sort divides the array into sorted and unsorted portions. It repeatedly finds the minimum element from the unsorted portion and swaps it with the first unsorted element. Time complexity is O(n^2) for all cases (always scans entire unsorted portion). Space is O(1). Performs fewer swaps than bubble sort (O(n) vs O(n^2)), making it useful when write operations are expensive.
IIT Certified
Master These Concepts with IIT Certification
175+ hours of industry projects. Get placed at Bosch, Tata Motors, L&T and 500+ companies.
Relevant for Roles
Software Engineer Junior Developer Student