Skip to content

Instantly share code, notes, and snippets.

@easleyschool
Created October 10, 2019 03:51
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/8b330292e6c08e3b98e308ed6cc6813e to your computer and use it in GitHub Desktop.
Save easleyschool/8b330292e6c08e3b98e308ed6cc6813e to your computer and use it in GitHub Desktop.
/*
Data structure below represents a simple Linked List
*/
class LinkedList
{
private:
/* define the list it self */
node *head;
public:
//function to add Node at front
int addAtFront(node *n);
//function to check whether Linked list is empty
int isEmpty();
//function to add Node at the End of list
int addAtEnd(node *n);
//function to search a value
node* search(int k);
//function to delete any Node
node* deleteNode(int x);
/*
Initialization (default construction)
*/
LinkedList()
{
head = NULL;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment