Selection sort is a simple sorting algorithm that works by iteratively finding the minimum element from the unsorted part of the array and placing it at the beginning. It divides the array into a sorted and unsorted part. In each step, the smallest element is selected from the unsorted array and swapped with the leftmost element, adding it to the sorted part. This process continues until the array is fully sorted, resulting in either ascending or descending order. However, selection sort has a time complexity of O(n^2) and is not suitable for large datasets due to its inefficiency.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
577 views
Presentation On Selection Sort
Selection sort is a simple sorting algorithm that works by iteratively finding the minimum element from the unsorted part of the array and placing it at the beginning. It divides the array into a sorted and unsorted part. In each step, the smallest element is selected from the unsorted array and swapped with the leftmost element, adding it to the sorted part. This process continues until the array is fully sorted, resulting in either ascending or descending order. However, selection sort has a time complexity of O(n^2) and is not suitable for large datasets due to its inefficiency.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9
Presentation
on Selection Sort Basics of Selection Sort:
1. It is Simple sorting algorithm.
2. It finds the minimum or maximum element in an unsorted array and then putting it in its correct position. 3.It is also comparison-based algorithm in which the list is divided into two parts: i. The sorted part ii. The unsorted part Process of Selection sort:
The smallest element is selected from the unsorted
array and swapped with the leftmost element. ie, That element becomes a part of the sorted array. This process continues moving unsorted array boundary by one element to the right until the final result. Result can be either in ascending or descending order. Pictorial Representation of Selection Sort: Procedures of Selection Sorting:
1. Comparison: The times of comparison in a n value
array is (n(n-1))/2. 2. Value Assignment: The times of value assignment is between 0 to 3(n-1). 3. Exchanging: The times need is between 0 to (n-1). Hence, This algorithm is not suitable for large data sets as its average and worst case complexities are of Ο(n2), where n is the number of items. Disadvantage os Selection Sort:
1. The algorithm of Selection sort will vary in different
kinds of data structures. 2. If the data structure is stack or queue, the algorithm is different. 3. The algorithm can not run in-place, the execution need extra memory in computer. 4. The algorithm need extra memory to temporary store the value which need to be changed in the swap method.