Thursday, May 06, 2010

Farmville and heap sort



This actually happened. :) Also, the algorithms I saw on the internet were using recursion and I wasn't.

5 comments:

Anirudh Patil said...

did it work?

Hashish said...

if it is my algo you are talking about, it worked.

Ess Dee said...

Rule #1 of programming: Never write what you can find a library function for.

Also, why loop when you can recurse?

Hashish said...

@Ess Dee: I was analyzing the algo and trying to understand why it is considered to be one of the most efficient. Why would I write an entire program that just sorts when that routine has been implemented 10^6 times by various SDKs? :)

Ess Dee said...

Indeed that is cool. It seems you don't have much work nowadays. Let's play cricket.