|
|
|
|
|
by mort96
3129 days ago
|
|
I’m not convinced anyone unfamiliar would likely fail. A pretty obvious solution is to just have a list of all nodes you’ve been to, and check if the current node is in that list. Not the most optimal solution, but one I’d imagine a lot of decent programmers would be able to come up with. Not saying it’s a good interview question, just that most good programmers shoukd be able to come up with some form of answer if they understand linked lists. |
|