From 2b673773746eaa32fe092071c08f96ce2f0119b9 Mon Sep 17 00:00:00 2001 From: paras-dahiya <64472569+paras-dahiya@users.noreply.github.com> Date: Fri, 2 Oct 2020 12:24:08 +0530 Subject: [PATCH] selection sort --- selection sorting.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 selection sorting.py diff --git a/selection sorting.py b/selection sorting.py new file mode 100644 index 0000000..c5a13f9 --- /dev/null +++ b/selection sorting.py @@ -0,0 +1,17 @@ +#selction sort +n=int(input("Enter the number of elements u want in the list to sort")) +list=[] +for i in range(0,n): + element=int(input("ENter the element for the list")) + list.append(element) +print("before sorting") +print(list) +for i in range(0,len(list)-1): + minindex=i + for j in range(i+1,len(list)): + if list[j]