Home ListNode manipulation

Traversing list nodes

Note: this is less of a rule, and more of a rough guideline.

When manipulating node objects for linked lists, it is often a bad idea to try and "traverse backwards". Try and structure your code so you only ever need to iterate "forward" over a linked list.

Manipulating and creating ListNodes

When working on linked list or ListNode problems, you may never modify the data field (or the equivalent on homework assignments).

You should also keep the number of new ListNode objects you create to the bare minimum necessary needed to solve the problem. However, do note that you are free to create as many references to ListNodes as you want, unless told otherwise.

Final fields and variables

You should never attempt to modify any field or variable that is marked as final. You should also never attempt to remove the final keyword from any instructor-provided code unless explicitly told otherwise.