4 ms·
"The algorithm design is all said out loud." Ok, I thought it was being written as a code, even if just on paper or a board. "accepted that faster was better"
by klibertp 14y ago
"The algorithm design is all said out loud."
Ok, I thought it was being written as a code, even if just on paper or a board.
"accepted that faster was better"
The point we - grey-area and I - are trying to make is that it's not always the case, or rather that the "betterness" of faster implementation is, in practice, dependent in large parts on other characteristics of the code. If someone deleted slower implementation along with tests and docs and replaced it with faster, but undocumented, untested implementation I would not consider it a change for the better.
And I think you would agree with this in general (of course there are situations when a change like this is necessary!), and I think this is just a misunderstanding on my part - I was thinking about actual code, an implementation, all along while you were talking about description of the algorithm with words. In this case - with one additional assumption that memory complexity is irrelevant or not changed, but that's nitpicking - of course faster is better! :)
"I think you can write the code to figure out the biggest number in a list"
Yes, of course: (foldl max (first lst) (rest lst))
And I can even explain what foldl is and how it works.
"you shouldn't be intimidated by "algorithm invention.""
I am not "intimidated". I know my limits. I wouldn't be able to invent quicksort during the interview and I wouldn' be able to invent this: http://www.jstor.org/discover/10.2307/2346806 http://www.jstor.org/discover/10.2307/2346806 even if my life depended on this and I was given all the time of universe to do this (but I still coded it).
This also depends on what we mean by "inventing". Does using some previously learned technique or adjusting other already known algorithm count as an invention?
But from what you say I gather that you wouldn't want me to invent quicksort on the spot - and then it's ok, it seems like I still have a chance of getting a job! ;)
- hvidgaard 14y agohttp://www.jstor.org/discover/10.2307/2346806 http://www.jstor.org/discover/10.2307/2346806 was not something someone came up with after a few days at it. They had deep understanding of the statistics behind the algorithm, and an almost unfathomable knowledge in the domain, not to mention a large network to help them. I'm sure that most intelligent people would be able come up with it if they had the same circumstances working in their favor.