CS205
Implement Singly LinkedList addFirst()Step 1 of 3
1
2
3
Create a new node

First, create a new Node containing the element to be added.

Loading editor...
Learning Objectives
  • Understand node creation
  • Learn to update head pointer
  • Handle the empty list case