SlideShare a Scribd company logo
SELECTION SORT
Vipin Ramola
PGT Comp. Sc.
KV Balasore
Bhubaneswar Region
1
2
OBJECTIVES
 To learn sorting
 To learn about Selection Sort – writing
program
 Application of Selection Sort
 Advantages & Disadvantages
3
PREVIOUS KNOWLEDGE
 Variables
 Loops
 Functions
4
Sorting
 Arranging elements/data/items in ascending
or descending order of values.
 Fundamental problems in computer science
and programming
 Sorting done to make searching easier
 Multiple different algorithms to solve the
same problem
5
Selection sort
 Algorithm
– Search through the list and find the smallest element
– swap the smallest element with the first element
– repeat starting at second element and find the second
smallest element and so on
Program
6
for(i=0; i< n-1; i++)
{
/* find the index of min element in the unsorted a[j ..
n-1] assume the min is the first element */
minIndex=i;
// test against elements after j to find the smallest
for(j=i+1; j< n; j++)
{
// if this element is less, then it is the new minimum
if(A[j] < A[minIndex])
minIndex = j;
}
/* iMin is the index of the minimum element. Swap it
with the current position */
if(minIndex!=i)
{
temp = A[i];
A[i]=A[minIndex];
A[minIndex] = temp;
}
}
7
ANIMATION
8
Applications of Selection Sort
 In embedded systems
 In basic mobiles
Advantages & Disadvantages
Advantages
Easy/simple implementation.
Useful when no. of elements are less.
Can be used when memory is less.
Disadvantages
It is slower when no of elements are more.
Performance varies with initial order of Input
9
Thank You
10

More Related Content

PPTX
Presentation on the topic selection sort
District Administration
 
PPTX
Selection sort 1
asmhemu
 
PPTX
Selection sorting
Himanshu Kesharwani
 
PPTX
Insertion sort
almaqboli
 
PPTX
Selection sort
smlagustin
 
PPTX
Merge sort algorithm power point presentation
University of Science and Technology Chitttagong
 
PPT
Selection sort
stella D
 
PPTX
Insertion sort
Monalisa Patel
 
Presentation on the topic selection sort
District Administration
 
Selection sort 1
asmhemu
 
Selection sorting
Himanshu Kesharwani
 
Insertion sort
almaqboli
 
Selection sort
smlagustin
 
Merge sort algorithm power point presentation
University of Science and Technology Chitttagong
 
Selection sort
stella D
 
Insertion sort
Monalisa Patel
 

What's hot (20)

PPTX
Bubble sort | Data structure |
MdSaiful14
 
PPTX
Sorting Algorithms
Pranay Neema
 
PPT
Insertion sort
Delowar Hossain
 
PPTX
Quick sort
Dhruv Sabalpara
 
PPTX
Bubble Sort Algorithm Presentation
AhmedAlbutty
 
PPT
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
PPTX
Radix sorting
Madhawa Gunasekara
 
PPTX
Quick sort
Jehat Hassan
 
PPTX
Insertion Sort
Brett Duncan
 
PPTX
Selection sort algorithm presentation, selection sort example using power point
University of Science and Technology Chitttagong
 
PPT
Selection sort
amna izzat
 
PDF
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 
PPTX
Quick sort
amar kakde
 
PPTX
Analysis of Algorithm (Bubblesort and Quicksort)
Flynce Miguel
 
PPTX
Insertion sort algorithm power point presentation
University of Science and Technology Chitttagong
 
PPT
3.5 merge sort
Krish_ver2
 
PPTX
Searching techniques in Data Structure And Algorithm
03446940736
 
PPTX
Merge sort
Sindhoo Oad
 
PPTX
Different Sorting tecniques in Data Structure
Tushar Gonawala
 
PPTX
Searching & Sorting Algorithms
Rahul Jamwal
 
Bubble sort | Data structure |
MdSaiful14
 
Sorting Algorithms
Pranay Neema
 
Insertion sort
Delowar Hossain
 
Quick sort
Dhruv Sabalpara
 
Bubble Sort Algorithm Presentation
AhmedAlbutty
 
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Radix sorting
Madhawa Gunasekara
 
Quick sort
Jehat Hassan
 
Insertion Sort
Brett Duncan
 
Selection sort algorithm presentation, selection sort example using power point
University of Science and Technology Chitttagong
 
Selection sort
amna izzat
 
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 
Quick sort
amar kakde
 
Analysis of Algorithm (Bubblesort and Quicksort)
Flynce Miguel
 
Insertion sort algorithm power point presentation
University of Science and Technology Chitttagong
 
3.5 merge sort
Krish_ver2
 
Searching techniques in Data Structure And Algorithm
03446940736
 
Merge sort
Sindhoo Oad
 
Different Sorting tecniques in Data Structure
Tushar Gonawala
 
Searching & Sorting Algorithms
Rahul Jamwal
 
Ad

Similar to Selection Sort - Vipin Ramola (20)

PPT
SIMPLE SORTING MUKUND
Mukund Trivedi
 
PPTX
Sorting And Type of Sorting
MITULJAMANG
 
PPT
Sorting algorithums > Data Structures & Algorithums
Ain-ul-Moiz Khawaja
 
PPTX
Sorting Algorithms
Afaq Mansoor Khan
 
PPT
simple-sorting algorithms
Ravirajsinh Chauhan
 
PPTX
Selection and insertion sort
Ann Tugade
 
PDF
Advanced Topics In Java Core Concepts In Data Structures Noel Kalicharan
fickolatigo
 
PDF
Algorithms Analysis
Mohammed Hussein
 
PDF
Unit v data structure-converted
Shri Shankaracharya College, Bhilai,Junwani
 
ODP
Sorting Algorithm
Abu Shaik saurab
 
PPTX
Selection and insertion sort
Ann Tugade
 
PPTX
Lecture3a sorting
mbadhi barnabas
 
PDF
Sorting Algorithms: Bubble Sort, Selection Sort,
Dr. Madhuri Jawale
 
PPTX
Selection Sort & Insertion Sorts Algorithms
Ahmad177077
 
PPTX
SORTING techniques.pptx
Dr.Shweta
 
PPTX
Selection sort and insertion sort
May Ann Mendoza
 
PPTX
Selection Sort and Insertion Sort
tamayaoraquel
 
PDF
selectionsortselectionsortselectionsortselectionsort
C Abdul Hakeem College of Engineering and Technology
 
PDF
selection
ObedurRahman1
 
PPTX
Sorting method data structure
sunilchute1
 
SIMPLE SORTING MUKUND
Mukund Trivedi
 
Sorting And Type of Sorting
MITULJAMANG
 
Sorting algorithums > Data Structures & Algorithums
Ain-ul-Moiz Khawaja
 
Sorting Algorithms
Afaq Mansoor Khan
 
simple-sorting algorithms
Ravirajsinh Chauhan
 
Selection and insertion sort
Ann Tugade
 
Advanced Topics In Java Core Concepts In Data Structures Noel Kalicharan
fickolatigo
 
Algorithms Analysis
Mohammed Hussein
 
Unit v data structure-converted
Shri Shankaracharya College, Bhilai,Junwani
 
Sorting Algorithm
Abu Shaik saurab
 
Selection and insertion sort
Ann Tugade
 
Lecture3a sorting
mbadhi barnabas
 
Sorting Algorithms: Bubble Sort, Selection Sort,
Dr. Madhuri Jawale
 
Selection Sort & Insertion Sorts Algorithms
Ahmad177077
 
SORTING techniques.pptx
Dr.Shweta
 
Selection sort and insertion sort
May Ann Mendoza
 
Selection Sort and Insertion Sort
tamayaoraquel
 
selectionsortselectionsortselectionsortselectionsort
C Abdul Hakeem College of Engineering and Technology
 
selection
ObedurRahman1
 
Sorting method data structure
sunilchute1
 
Ad

More from Dipayan Sarkar (18)

PPT
Relationships
Dipayan Sarkar
 
PPTX
ideal learning space
Dipayan Sarkar
 
PPTX
introduction to aep arc
Dipayan Sarkar
 
PPTX
why focus on adolescents unique needs
Dipayan Sarkar
 
PPT
aep in india milestones, learning, way forward
Dipayan Sarkar
 
PDF
Softskills - S Fernandez
Dipayan Sarkar
 
PDF
Project Based Learning- Ashish K Chaurdia
Dipayan Sarkar
 
PDF
Linux and the Open Source- D Sarkar
Dipayan Sarkar
 
PPT
File Handling - N K Upadhyay
Dipayan Sarkar
 
PPTX
Sorting Techniques - Govardhan Satish
Dipayan Sarkar
 
PPTX
Application of Stack - Yadraj Meena
Dipayan Sarkar
 
PPT
Information Technology Act 2000 - Santosh K Pathak
Dipayan Sarkar
 
PPTX
Universal Gates - Aneesa N Ali
Dipayan Sarkar
 
PPT
Deletion of a Record from a File - K Karun
Dipayan Sarkar
 
PPTX
Java Databse Connectvity- Alex Jose
Dipayan Sarkar
 
PPTX
Computer Viruses- B S Kalyan Chakravarthy
Dipayan Sarkar
 
PPT
Cloud Computing- Sreehari S
Dipayan Sarkar
 
PPTX
SQL JOINS- Reena P V
Dipayan Sarkar
 
Relationships
Dipayan Sarkar
 
ideal learning space
Dipayan Sarkar
 
introduction to aep arc
Dipayan Sarkar
 
why focus on adolescents unique needs
Dipayan Sarkar
 
aep in india milestones, learning, way forward
Dipayan Sarkar
 
Softskills - S Fernandez
Dipayan Sarkar
 
Project Based Learning- Ashish K Chaurdia
Dipayan Sarkar
 
Linux and the Open Source- D Sarkar
Dipayan Sarkar
 
File Handling - N K Upadhyay
Dipayan Sarkar
 
Sorting Techniques - Govardhan Satish
Dipayan Sarkar
 
Application of Stack - Yadraj Meena
Dipayan Sarkar
 
Information Technology Act 2000 - Santosh K Pathak
Dipayan Sarkar
 
Universal Gates - Aneesa N Ali
Dipayan Sarkar
 
Deletion of a Record from a File - K Karun
Dipayan Sarkar
 
Java Databse Connectvity- Alex Jose
Dipayan Sarkar
 
Computer Viruses- B S Kalyan Chakravarthy
Dipayan Sarkar
 
Cloud Computing- Sreehari S
Dipayan Sarkar
 
SQL JOINS- Reena P V
Dipayan Sarkar
 

Recently uploaded (20)

PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
CDH. pptx
AneetaSharma15
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 

Selection Sort - Vipin Ramola

  • 1. SELECTION SORT Vipin Ramola PGT Comp. Sc. KV Balasore Bhubaneswar Region 1
  • 2. 2 OBJECTIVES  To learn sorting  To learn about Selection Sort – writing program  Application of Selection Sort  Advantages & Disadvantages
  • 4. 4 Sorting  Arranging elements/data/items in ascending or descending order of values.  Fundamental problems in computer science and programming  Sorting done to make searching easier  Multiple different algorithms to solve the same problem
  • 5. 5 Selection sort  Algorithm – Search through the list and find the smallest element – swap the smallest element with the first element – repeat starting at second element and find the second smallest element and so on
  • 6. Program 6 for(i=0; i< n-1; i++) { /* find the index of min element in the unsorted a[j .. n-1] assume the min is the first element */ minIndex=i; // test against elements after j to find the smallest for(j=i+1; j< n; j++) { // if this element is less, then it is the new minimum if(A[j] < A[minIndex]) minIndex = j; } /* iMin is the index of the minimum element. Swap it with the current position */ if(minIndex!=i) { temp = A[i]; A[i]=A[minIndex]; A[minIndex] = temp; } }
  • 8. 8 Applications of Selection Sort  In embedded systems  In basic mobiles
  • 9. Advantages & Disadvantages Advantages Easy/simple implementation. Useful when no. of elements are less. Can be used when memory is less. Disadvantages It is slower when no of elements are more. Performance varies with initial order of Input 9