Inserting a Node at the Front
insert_ptr = new Node;
insert_ptr->data = entry;
insert_ptr->link = head_ptr;
head_ptr = insert_ptr;
10
15
7
null
head_ptr
13
When the function returns, the
linked list has a new node at the
front, containing 13.
Previous slide
Next slide
Back to first slide
View graphic version