load
load
load
load
load
load
load
load
Sugarcane will be shutting down on June 30, 2018. For more information, .

Linked List Algorithms

Nodes are defined as typedef struct node { int data; struct node * next; } node; The head of the list is given by node * head.
a data set by Aaron
created February 5, 2016
COPY & EDIT
FAMILY TREE
LineInsert SortedMemberLine 2Delete
1if (!head)node * n = head;1node **prev = &head, *n = head;
2head = nn;do {2while (n && n->data <= data)
3elseif (!n || n->data > data) 3{
4{return false;4if (n->data == data)
5node **prev = &head, * n = head;if (n->data == data) 5{
6while (n && n->data < nn->data)return true;6*prev = n->next;
7{n = n->next;7free(n);
8prev = &(n->next);} while (1);8return;
9n = n->next;9}
10}10prev = &(n->next);
11*prev = nn;11n = n->next;
11nn->next = n;12}
12}
Ready to learn about Linked List Algorithms?