3 ms·
This. There's a lot of babbling about how coding is the limiting factor, but it really isn't. What people struggle with is solving the problems in their head.
by qsort 4y ago
This.
There's a lot of babbling about how coding is the limiting factor, but it really isn't. What people struggle with is solving the problems in their head. Writing the actual code after you've done that is almost trivial.
Another angle is how you need to think in abstract terms in the solution space. Most people whose knowledge of algorithms is weak think like: "okay, the problem says the word 'array' so I probably need a quicksort here". People who are successful think like "if this array were sorted, I could search an element in O(lg n) time instead of O(lg n). Can I solve the problem with this additional hypothesis?".
It's almost like being a chess player: when you're weak you come up with moves and hope they work, when you get stronger you look at a position and come up with plans and reasons why certain moves will or will not work.
The top-down mode of thinking is how you write a solution but not how you come up with one, the actual process is more "inside out", you find out stuff thinking about the problem and then you connect the dots.
Part of it is just experience and wit, but much can be taught, and formal mathematics helps the most.