| 93 | } |
| 94 | |
| 95 | void deleteList(struct Node *p , int index) |
| 96 | { |
| 97 | struct Node *prev; |
| 98 | |
| 99 | if(index == 0){ |
| 100 | |
| 101 | // pointing to 1st node |
| 102 | prev = first; |
| 103 | |
| 104 | // pointing to 2nd node |
| 105 | first = first->next; |
| 106 | |
| 107 | delete prev; |
| 108 | } |
| 109 | |
| 110 | else{ |
| 111 | |
| 112 | for (int i = 0; i < index-1; i++) |
| 113 | { |
| 114 | prev = p; |
| 115 | p = p->next; |
| 116 | } |
| 117 | |
| 118 | prev->next = p->next; |
| 119 | delete p; |
| 120 | |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | struct Node *searchList(struct Node *p, int target) |
| 125 | { |
nothing calls this directly
no outgoing calls
no test coverage detected