Python Forum
Manual Sort without Sort function
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manual Sort without Sort function
#7
(Oct-13-2017, 11:06 AM)dtweaponx Wrote: I wish we could use quick sort, but the teacher said no, we have to develop our own sort system by seeing which number is the smallest in the 3 numbers the user typed in, it could be any order the user typed in like 50, 2 1 or 4, 30, 1 or 4, 1, 30. So the code would find the smallest and assign the smallest number to the small variable after it checked all 3 inputs, than it would move onto the next one to find say the largest. and then I'd guess to find the middle one would simply a if statement like if middle is larger than smallest but less than largest it would be middle?

Wow! How frustrating. Well, have fun, and don't forget to deal with the unusual inputs (unless the teacher promised 'happy-path' only. Smile )
I am trying to help you, really, even if it doesn't always seem that way
Reply


Messages In This Thread
Manual Sort without Sort function - by dtweaponx - Oct-13-2017, 02:04 AM
RE: Manual Sort without Sort function - by gruntfutuk - Oct-13-2017, 01:59 PM
RE: Manual Sort without Sort function - by buran - Oct-13-2017, 08:29 AM
RE: Manual Sort without Sort function - by snippsat - Oct-13-2017, 02:58 PM
RE: Manual Sort without Sort function - by wavic - Oct-13-2017, 06:33 PM
RE: Manual Sort without Sort function - by Mekire - Oct-13-2017, 11:28 PM
RE: Manual Sort without Sort function - by wavic - Oct-14-2017, 01:05 AM
RE: Manual Sort without Sort function - by Mekire - Oct-14-2017, 01:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Frog codility leap sort variant MoreMoney 5 587 Apr-06-2024, 08:47 PM
Last Post: deanhystad
  How to sort a list with duplicates and return their unique indices. Echoroom 3 3,596 Sep-23-2022, 07:53 AM
Last Post: deanhystad
  sorting a list using unicodes acending order, no loops, no sort(), using recursion lrn2codee 14 6,562 Jun-23-2021, 07:33 PM
Last Post: deanhystad
  Sort and merge flintstone 1 1,951 Jun-14-2021, 07:32 PM
Last Post: Larz60+
  How can I sort my column so that NaN is at the bottom? soft 3 2,473 Feb-06-2021, 01:02 PM
Last Post: ibreeden
  how to sort a list without .sort() function letmecode 3 3,509 Dec-28-2020, 11:21 PM
Last Post: perfringo
  Sort on basis of (name,age,score) pyzyx3qwerty 9 9,702 May-14-2020, 08:29 AM
Last Post: pyzyx3qwerty
  Sort last pyzyx3qwerty 7 4,853 May-05-2020, 02:58 PM
Last Post: DeaD_EyE
  insertion sort brobro 3 2,257 Apr-24-2020, 01:29 PM
Last Post: Godserena
  Sort objects by protected properties. Sigriddenfeta 1 1,927 Mar-17-2020, 04:11 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020