Python Tutorials - Selection Sort | Program | Using min() | For Non Duplicate Values | Part-1

Publicado el: 30 July 2018
en el canal de: Amulya's Academy
95,142
1.6k

In this Python programming video tutorial we will learn about selection sort algorithm in detail.

Selection sort is an in placed comparison based algorithm in which the list is divided into two parts, the sorted part at the left end and the unsorted part at the right end.

Here you can see how to write program using selection sort algorithm.
example:
56 3 2 78 6 0
first iteration:
min_val = 0,
so swap it to first index(swap 56 and 0)
output: 0 3 2 78 6 56

second iteration:
min_val = 2
so,swap 3 and 2
output: 0 2 3 78 6 56

third iteration:
min_val =3
so swap 3 with 3
output: 0 2 3 78 6 56

4th iteration:
min_val =6
so swap 78 and 6
output: 0 2 3 6 78 56

5th iteration:
min_val =56
swap 78 and 56
output is: 0 2 3 6 56 78

6th iteration:
min_val = 78
so swap 78 with 78
output is: 0 2 3 6 56 78.

Selection sort algorithm:    • Python Tutorials - Selection Sort Alg...  

This Program won't work for duplicate values.
to make it work for duplicate values watch:
   • Python Tutorials - Selection Sort | P...  

#PythonProgramming #Python #PythonCourse

For more free tutorials on computer programming
  / amulsacademy  
  / amulsacademy  


En esta página del sitio puede ver el video en línea Python Tutorials - Selection Sort | Program | Using min() | For Non Duplicate Values | Part-1 de Duración hora minuto segunda en buena calidad , que subió el usuario Amulya's Academy 30 July 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 95,142 veces y le gustó 1.6 mil a los espectadores. Disfruta viendo!