+ 8

CHALLENGE - Sort The Figures!

In your preferred language, write two functions/ methods (ascending and descending) that take numbers/figures as arguments and return the figures sorted: For instance, Sort(5, 3, 11, 8, 4, 3, 2, 6, 9) should return 2, 3, 3, 4, 5, 6, 8, 9, 11 for ascending sort and 11, 9, 8, 6, 5, 4, 3, 3, 2 for descending sort. PS: Code from scratch. Use no built in sort methods or functions. ✌

27th Dec 2017, 5:27 PM
Power'f GOD⚡⚡
Power'f GOD⚡⚡ - avatar
5 Antworten
28th Dec 2017, 8:44 AM
Power'f GOD⚡⚡
Power'f GOD⚡⚡ - avatar
+ 2
Waoh. Cool. But only flaw is that your function takes no arguments. One should be able to use it like a method. Also it shouldn't take an array as its parameter. Should be something like this Sort(5, 6, 2, 8, 4) not Sort([5, 6, 2, 8, 4]) and there should be two functions "SortAscending(arguments)" and "SortDescending(arguments) independent of each other. Good job BTW. ;)
28th Dec 2017, 8:18 AM
Power'f GOD⚡⚡
Power'f GOD⚡⚡ - avatar
+ 1
this is a python implementation Mr. Power https://code.sololearn.com/cjpKgCHW9bV2/?ref=app
25th Feb 2018, 6:28 AM
Benjamin Chibuzor-orie
Benjamin Chibuzor-orie - avatar
0
Hey Sunday. I'm. new to solo learn I need help
29th Dec 2017, 1:29 AM
Victoria Mcking