13 Node * current = head;
14 while (current != NULL)
17 cout << current->
info <<
" -> ";
18 current = current->
next;
45 if (head == NULL || head->
info >= num )
49 Node * current = head;
51 while (current->
next != NULL) {
55 current = current->
next;
63 Node * current = head;
65 while (current != NULL) {
66 if (current->
info == num)
69 current = current->
next;
96 cout << endl <<
"enter option (1: insert; 2: delete; 0: quit) ";
104 cout << endl <<
"number to insert: ";
108 if (after_this == NULL)
117 cout << endl <<
"number to delete: ";
123 cout <<
"item not found!" << endl;
137 while ( head != NULL )
146 Node * head = NULL, * after_this;
150 cout <<
"input integers (-999 to end): ";
152 while ( num != -999 ) {
155 if (after_this == NULL)
void delete_list(Node *&head)
void option_insert(Node *&head)
Node * find_prev(Node *head, int num)
void delete_head(Node *&head)
void head_insert(Node *&head, int num)
void delete_node(Node *after)
void insert(Node *after, int num)
void option_delete(Node *&head)
void print_list(Node *head)
Node * find(Node *head, int num)