New answers tagged

3 votes

Adding Node to Linked List

Your code looks good, and you've gotten some good suggestions from others already, but I would advise to think about the intended usage, about responsiblity of the class(es), and about encapsulation. ...
ades's user avatar
  • 1,261
6 votes

Adding Node to Linked List

Summary I won't dwell on what has already been cited by users toolic and J_H, so I just have a few comments: Type Hinting I would suggest that you include type hinting, especially if your functions do ...
Booboo's user avatar
  • 1,636
5 votes

Adding Node to Linked List

names class ListNode: This is a perfectly fine identifier, as-is. There's no adjacent code that uses other node types. Consider shortening to just ...
J_H's user avatar
  • 25k
3 votes

Adding Node to Linked List

Overview You've done an excellent job: You did a good job partitioning code into functions You used meaningful names for the class, functions and variables You showed an example of how to run the ...
toolic's user avatar
  • 3,181

Top 50 recent answers are included