Python Forum
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sort only the odd numbers
#2
My thoughts.

Once the odd numbers have been sorted.
Scan the original array, search for even numbers, once you have an even number, calculate its position and then insert it into the new array in that position.

Is this what you are looking for?

Bass

"The good thing about standards is that you have so many to choose from" Andy S. Tanenbaum
Reply


Messages In This Thread
Sort only the odd numbers - by tomhuang - Jul-20-2017, 05:10 PM
RE: Sort only the odd numbers - by Bass - Jul-20-2017, 05:15 PM
RE: Sort only the odd numbers - by nilamo - Jul-20-2017, 06:00 PM
RE: Sort only the odd numbers - by ichabod801 - Jul-20-2017, 06:02 PM
RE: Sort only the odd numbers - by ichabod801 - Jul-20-2017, 06:07 PM
RE: Sort only the odd numbers - by buran - Jul-20-2017, 08:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo a.sort() == b.sort() all the time 3lnyn0 1 1,450 Apr-19-2022, 06:50 PM
Last Post: Gribouillis
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,939 May-09-2019, 12:19 PM
Last Post: Pleiades
  Need Help: Sort of Binary numbers based on 1's present abinashj 5 5,259 Jul-25-2017, 12:23 PM
Last Post: buran

Forum Jump:

User Panel Messages

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