8
Most read
9
Most read
10
Most read
Selection sort algorithm presentation, selection sort example using power point
#Presentation submitted to:
Sohrab Hossain, Assistant professor of CSE
FSET,USTC
#Presentation submitted by:
Md Abdul Kuddus
Department of CSE
ID:15010102
Batch:25th
#Presentation Name:
Write a program to sort the element of
an array using selection sort.
#What is selection sort??
 Repeatedly searches for the largest value in a section of the
data
 Moves that value into its correct position in a sorted
section of the list
 Uses the Find Largest algorithm
#Example:
Given array: 34 8 64 51 32 21
sorted comparison item unsorted
comparison time
0 1 2 3 4 5
*pass 1: compare 1st position with minimum item
After pass1
*pass2: compare 2nd position with next minimum item
After pass2
34 8 64 51 21
8
34 64 51 218
34 64 51 21
8 21 64 51 34
*pass3: compare 3rd position with next minimum item
After pass3
*pass4: compare 4th position with next minimum item
After pass4
Array is sorted
8 21 64 51 34
8 21 34 51 64
8 21 34 51 64
8 21 34 51 64
*Algorithm:
Algorithm SELECTION(A,N)
Step1 : Repeat steps 2 and 3 for k=1,2,….N-1;
Step2 : Call MIN(A,K,N,LOC).
Step3: [Interchange A[k] and A[LOC].]
Set TEMP:=A[k],
A[k]:=A[LOC] and
A[LOC]:=TEMP.
[End of step 1 loop]
Step4:Exit.
#source code:
#include <stdio.h>
int *selectionSort(int A[],int n)
{
int j ,k ,temp;
for (k= 0; k < n; k++)
{
for(j = k+1; j < n; j++)
{
if(A[k] > A[j])
{
temp = A[k];
A[k] = A[j];
A[j] = temp;
}
}
}
return A;
}
int main()
{
int A[1000],k,n;
printf("Enter the number of element you want to Sort : ");
scanf("%d",&n);
printf("Enter Elements in the list : ");
for(k = 0; k < n; k++)
{
scanf("%d",&A[k]);
}
int *sortArray = selectionSort(A,n);
printf("Sorted list : ");
for(k = 0; k < n; k++ )
{
printf("%dt",sortArray[k]);
}
}
#Time efficiency
 Comparisons: n(n-1)/2
 Exchanges: n (swapping largest into place)
 Overall: (n2), best and worst cases
#Space efficiency
 Space for the input sequence, plus a constant number of local
variables
Selection sort algorithm presentation, selection sort example using power point

More Related Content

PPTX
Insertion sort
PPTX
Presentation on the topic selection sort
PPTX
Selection sort
PPTX
Linked list
PPTX
Queue in Data Structure
PPT
Selection sort
PPTX
Selection sorting
PPTX
Bubble Sort Algorithm Presentation
Insertion sort
Presentation on the topic selection sort
Selection sort
Linked list
Queue in Data Structure
Selection sort
Selection sorting
Bubble Sort Algorithm Presentation

What's hot (20)

PPTX
Bubble sort
PPTX
Deque and its applications
PPTX
Data Structures - Lecture 8 [Sorting Algorithms]
PPTX
queue & its applications
PPSX
Data Structure (Queue)
PPTX
Merge sort algorithm power point presentation
PDF
Searching and Sorting Techniques in Data Structure
PPTX
Quick sort
PPTX
Insertion sort
PPT
Queue Data Structure
PPTX
Selection sort 1
PPT
Binary search tree(bst)
PPTX
heap Sort Algorithm
PPT
Data Structures- Part5 recursion
PPT
Queue data structure
PPTX
Insertion in singly linked list
PPT
Data structures using c
PPTX
sorting and its types
PDF
Array data structure
PPTX
Bubble Sort
Bubble sort
Deque and its applications
Data Structures - Lecture 8 [Sorting Algorithms]
queue & its applications
Data Structure (Queue)
Merge sort algorithm power point presentation
Searching and Sorting Techniques in Data Structure
Quick sort
Insertion sort
Queue Data Structure
Selection sort 1
Binary search tree(bst)
heap Sort Algorithm
Data Structures- Part5 recursion
Queue data structure
Insertion in singly linked list
Data structures using c
sorting and its types
Array data structure
Bubble Sort
Ad

Similar to Selection sort algorithm presentation, selection sort example using power point (20)

PPTX
Data structure using c module 3
PPTX
DSA-sortijejjejjdjjdjdjjsjsjsjsjsjsjng.pptx
PPTX
Searching_Sorting.pptx
PPT
Insertion sort
PPT
Chapter 3 - Elementary Searching and Sorting Algorithms.ppt
PPT
CHAP 3 ALGORITHM for infomatique ingenieure .ppt
PPTX
Unit III Version I.pptx
PPT
Lecture k-sorting
PPT
lecture-k-sorting.ppt
PDF
Sorting and Searching Techniques
PPTX
Chapter 3 - Data Structure and Algorithms.pptx
PPT
lecture to proide studeny with F-k-sorting.ppt
PDF
advanced searching and sorting.pdf
PPTX
Data Structures_ Sorting & Searching
PPTX
DS - Unit 2 FINAL (2).pptx
PPTX
Chapter3.pptx
PPTX
Searching and sorting Techniques in Data structures
PPTX
Sorting and hashing concepts
PPTX
Sorting and hashing concepts
Data structure using c module 3
DSA-sortijejjejjdjjdjdjjsjsjsjsjsjsjng.pptx
Searching_Sorting.pptx
Insertion sort
Chapter 3 - Elementary Searching and Sorting Algorithms.ppt
CHAP 3 ALGORITHM for infomatique ingenieure .ppt
Unit III Version I.pptx
Lecture k-sorting
lecture-k-sorting.ppt
Sorting and Searching Techniques
Chapter 3 - Data Structure and Algorithms.pptx
lecture to proide studeny with F-k-sorting.ppt
advanced searching and sorting.pdf
Data Structures_ Sorting & Searching
DS - Unit 2 FINAL (2).pptx
Chapter3.pptx
Searching and sorting Techniques in Data structures
Sorting and hashing concepts
Sorting and hashing concepts
Ad

Recently uploaded (20)

PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
MLpara ingenieira CIVIL, meca Y AMBIENTAL
PPTX
wireless networks, mobile computing.pptx
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PPTX
CyberSecurity Mobile and Wireless Devices
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
PDF
Unit1 - AIML Chapter 1 concept and ethics
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
Design Guidelines and solutions for Plastics parts
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
mechattonicsand iotwith sensor and actuator
PPTX
ai_satellite_crop_management_20250815030350.pptx
"Array and Linked List in Data Structures with Types, Operations, Implementat...
MLpara ingenieira CIVIL, meca Y AMBIENTAL
wireless networks, mobile computing.pptx
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
CyberSecurity Mobile and Wireless Devices
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
Information Storage and Retrieval Techniques Unit III
Module 8- Technological and Communication Skills.pptx
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
Unit1 - AIML Chapter 1 concept and ethics
Exploratory_Data_Analysis_Fundamentals.pdf
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Design Guidelines and solutions for Plastics parts
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
mechattonicsand iotwith sensor and actuator
ai_satellite_crop_management_20250815030350.pptx

Selection sort algorithm presentation, selection sort example using power point

  • 2. #Presentation submitted to: Sohrab Hossain, Assistant professor of CSE FSET,USTC #Presentation submitted by: Md Abdul Kuddus Department of CSE ID:15010102 Batch:25th
  • 3. #Presentation Name: Write a program to sort the element of an array using selection sort. #What is selection sort??  Repeatedly searches for the largest value in a section of the data  Moves that value into its correct position in a sorted section of the list  Uses the Find Largest algorithm
  • 4. #Example: Given array: 34 8 64 51 32 21 sorted comparison item unsorted comparison time 0 1 2 3 4 5
  • 5. *pass 1: compare 1st position with minimum item After pass1 *pass2: compare 2nd position with next minimum item After pass2 34 8 64 51 21 8 34 64 51 218 34 64 51 21 8 21 64 51 34
  • 6. *pass3: compare 3rd position with next minimum item After pass3 *pass4: compare 4th position with next minimum item After pass4 Array is sorted 8 21 64 51 34 8 21 34 51 64 8 21 34 51 64 8 21 34 51 64
  • 7. *Algorithm: Algorithm SELECTION(A,N) Step1 : Repeat steps 2 and 3 for k=1,2,….N-1; Step2 : Call MIN(A,K,N,LOC). Step3: [Interchange A[k] and A[LOC].] Set TEMP:=A[k], A[k]:=A[LOC] and A[LOC]:=TEMP. [End of step 1 loop] Step4:Exit.
  • 8. #source code: #include <stdio.h> int *selectionSort(int A[],int n) { int j ,k ,temp; for (k= 0; k < n; k++) { for(j = k+1; j < n; j++) { if(A[k] > A[j]) { temp = A[k]; A[k] = A[j]; A[j] = temp; } } } return A; }
  • 9. int main() { int A[1000],k,n; printf("Enter the number of element you want to Sort : "); scanf("%d",&n); printf("Enter Elements in the list : "); for(k = 0; k < n; k++) { scanf("%d",&A[k]); } int *sortArray = selectionSort(A,n); printf("Sorted list : "); for(k = 0; k < n; k++ ) { printf("%dt",sortArray[k]); } }
  • 10. #Time efficiency  Comparisons: n(n-1)/2  Exchanges: n (swapping largest into place)  Overall: (n2), best and worst cases #Space efficiency  Space for the input sequence, plus a constant number of local variables