Get the latest tech news

I coded something dumb and I'm proud of it


When Simplicity is Preferrable to Efficiency

I needed to somehow create a function that performs a single step of the algorithm, then gives back control to the main loop (which ironically sounds just like an OS' preemptive scheduling) for the duration of the animation frames, before being executed again from where it was interrupted. To try and better explain what the comment means, here is the code of my Quicksort function that stops as soon as an actual change to the array is detected: You see, I realized along the way that the premise of my first problem described above was mistaken: my need was not, in fact, to implement a function that only executes the next recursion in the quicksort algorithm.

Get the Android app

Or read this on Hacker News