Unit 5 Session 1 (Click for link to problem statements)
Understand what the interviewer is asking for by using test cases and questions about the problem.
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Create two nodes and set the next
attribute of the first node (head) to reference the second node (tail).
1) Create a node with value 100 and store it in a variable named `head`.
2) Create a second node with value 200 and store it in a variable named `tail`.
3) Set the `next` attribute of the `head` node to point to the `tail` node, establishing the link between them.
⚠️ Common Mistakes
next
attribute, which would result in the nodes not being linked.head = Node(100)
tail = Node(200)
head.next = tail