reversi!

quicksorti've been fiddling with this sorting function that my friend wrote. it's a all-in-one quicksort function (normally the partition phase is a separate function you see) - which is pretty cool. what i wanted to do was to reverse the way it sorted numbers. easy enough you say...

that's what i thought. "all you need is to reverse everything!", i thought. but after a whole day, i discovered that wasn't gonna work. so i had to do it the hard way. understand the actualy code :P turns out i was right! (mostly).

in the end, all that was needed was to reverse 2 logical statements! whoah. i wish they taught me this in undergrad. wait, maybe they did *scratches head*

Comments

Popular Posts