Two-Node Linked List
hardQuestion 419A struct Node holds an int value and a struct Node *next pointer (a self-referential struct). Build a two-node list where the first node has value 1 and points to a second node with value 2 (whose next is NULL). Traverse the list from the head and print the values joined by -> (see Expected Output).
The two nodes can be plain local variables. There is no trailing newline.
Expected output
1 -> 2= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics
Structs
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.