Editing Talk:2483: Linked List Interview Problem
Please sign your posts with ~~~~ |
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
:I think part of the joke might be that the high-level language being used will actually spit out a representation of the entire list when using the str function. So it actually does all the traversing and abstracts it away, again making the interview question seem redundant! [[Special:Contributions/162.158.159.48|162.158.159.48]] 10:40, 1 July 2021 (UTC) | :I think part of the joke might be that the high-level language being used will actually spit out a representation of the entire list when using the str function. So it actually does all the traversing and abstracts it away, again making the interview question seem redundant! [[Special:Contributions/162.158.159.48|162.158.159.48]] 10:40, 1 July 2021 (UTC) | ||
::The language looks almost like Python -- the only difference being the keyword ''define'' instead of ''def''. Lisp is the only family of languages I can think of that automatically converts linked lists to a representation of all the elements, since the linked list is its fundamental data structure. [[User:Barmar|Barmar]] ([[User talk:Barmar|talk]]) 14:06, 1 July 2021 (UTC) | ::The language looks almost like Python -- the only difference being the keyword ''define'' instead of ''def''. Lisp is the only family of languages I can think of that automatically converts linked lists to a representation of all the elements, since the linked list is its fundamental data structure. [[User:Barmar|Barmar]] ([[User talk:Barmar|talk]]) 14:06, 1 July 2021 (UTC) | ||
− | |||
just to make sure I get this right. | just to make sure I get this right. | ||
Line 39: | Line 38: | ||
I think you're all missing the point of the joke: it's not the ''linked list'' itself but the ''interview question about linked lists'' that should be donated to the museum. A typical interview question is "how do you reverse a linked list?", with the interviewer expecting you to write down the algorithm where you walk down the list while creating a new linked list in the process, wiring up its "next" pointer to the previously visited element. For the first element you traverse, you set the "next" pointer of that element in the reversed list to nil, because it will be the last element in the reversed list. The final result is a pointer to the last visited element, which becomes the head of the reversed list. These kind of questions are stereotypical for programmer interviews (just like "how do you swap to numbers without using a temporary variable?") and therefore Cueball makes a snarky remark that this question is now so archaic that it should be in a historical museum of sorts.[[Special:Contributions/162.158.88.88|162.158.88.88]] 14:22, 5 July 2021 (UTC) | I think you're all missing the point of the joke: it's not the ''linked list'' itself but the ''interview question about linked lists'' that should be donated to the museum. A typical interview question is "how do you reverse a linked list?", with the interviewer expecting you to write down the algorithm where you walk down the list while creating a new linked list in the process, wiring up its "next" pointer to the previously visited element. For the first element you traverse, you set the "next" pointer of that element in the reversed list to nil, because it will be the last element in the reversed list. The final result is a pointer to the last visited element, which becomes the head of the reversed list. These kind of questions are stereotypical for programmer interviews (just like "how do you swap to numbers without using a temporary variable?") and therefore Cueball makes a snarky remark that this question is now so archaic that it should be in a historical museum of sorts.[[Special:Contributions/162.158.88.88|162.158.88.88]] 14:22, 5 July 2021 (UTC) | ||
− | :The text below the comment ("... donate their linked list ..." | + | :The text below the comment ("... donate their linked list ..." suggests the reading others have taken... |