News for hackers. Stuff that matters.
Re:How to Pass a Programming Interview by whatshisface on Tuesday March 08, 2016 @02:38PM (#11247885)
You don't need to know how to prove a big-O to optimize an algorithm. Anyone who can think about what their code is doing will have at least some sense of how much it is doing.

Honestly, I don't think calculating the O(f(n)) is ever worth it outside of academia. Intuition is only slightly worse, and it is just so much time-cheaper.

Re:How to Pass a Programming Interview by quanticle on Tuesday March 08, 2016 @02:46PM (#11247952)

    Honestly, I don't think calculating the O(f(n)) is ever worth it outside of 
    academia. Intuition is only slightly worse, and it is just so much 
    time-cheaper.
Sure. I've never been asked for a formal mathematical proof of the Big-O complexity of my algorithms in an interview. And, as an interviewer, I've never asked. Intuition is exactly what interviews are looking for. If an algorithm has a nested for loop, and the inner loop is traversing the full data set, you should be able to say, "Oh, yeah, that looks like O(n^2) time complexity." If an algorithm is storing every element of a data-set in memory, you should be able to say, "That's O(n) space complexity."

Big-O notation, in practice, is a handy shorthand for talking about various classes of algorithms, and ranking them in order of how much time/space they take.