3 ms·
A linked list is one of those things everybody thinks is trivial to write until they actually try to write one that supports all the normal operations and actua
by Sharlin 10y ago
A linked list is one of those things everybody thinks is trivial to write until they actually try to write one that supports all the normal operations and actually works in all corner cases.
- robotresearcher 10y agoWhich is one of the reasons why we give it has homework in college. Not because you're going to do it in the workplace, but because (a) you see how the implementation entails the big-O behaviour you learned about, and (b) it's simple but tricky, thus training you to consider every aspect carefully. Aspect (b) is why people ask about it in interview questions. You are not expected to remember the details, you are expected to think about them as you go.
- NotSammyHagar 10y agoWhat are all those corner cases and hard problems? I routinely ask interview subjects to write code to manage a linked list (it was a small part of a problem in a previous job), and I've been asked to write a ll class. Writing a linked list is like hiring someone to be a professional driver, and you want to make sure they know that you can change tires, and that one should adjust mirrors to be able to see behind the car.