Skip to content

Instantly share code, notes, and snippets.

@easleyschool
Created October 9, 2019 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easleyschool/076def7f993aa1fd1d3d91ccd25daf91 to your computer and use it in GitHub Desktop.
Save easleyschool/076def7f993aa1fd1d3d91ccd25daf91 to your computer and use it in GitHub Desktop.
void Doubly_Linked_List :: add_front(int d)
{
// Creating new node
node *temp;
temp = new node();
temp->data = d;
temp->prev = NULL;
temp->next = front;
// List is empty
if(front == NULL)
end = temp;
else
front->prev = temp;
front = temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment