Aim:
To sort list of elements using selection sort
Algorithm:
Step1: Start
Step2:Read Upper Limit n
Step3: Read n elements to the list
Step4: Call Function Ssort(list)
Step5: FOR i=1 tle len(list)
Step5.1: least=1
Step5.2: pos=i
step5.3: FOR k=i+1 to len(list)
Step5.3.1 IF list[k]<list[least] THEN least=k
Step5.4: SWAP(list[least],list[i])
Step6: Print Sorted List
Step7:Return
Step8: Stop
To sort list of elements using selection sort
Algorithm:
Step1: Start
Step2:Read Upper Limit n
Step3: Read n elements to the list
Step4: Call Function Ssort(list)
Step5: FOR i=1 tle len(list)
Step5.1: least=1
Step5.2: pos=i
step5.3: FOR k=i+1 to len(list)
Step5.3.1 IF list[k]<list[least] THEN least=k
Step5.4: SWAP(list[least],list[i])
Step6: Print Sorted List
Step7:Return
Step8: Stop