Inserting a Node at the Front
void list_head_insert(Node*& head_ptr, const Node::Item& entry)
{
Node *insert_ptr;
insert_ptr = new Node;
insert_ptr->data = entry;
insert_ptr->link = head_ptr;
head_ptr = insert_ptr;
}
Does the function work
correctly for the empty
list ?
Previous slide
Next slide
Back to first slide
View graphic version