This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:data:fall2023:projects:ttb1 [2023/09/16 20:48] – [REMOVING A NODE FROM THE LIST] jwieland | notes:data:fall2023:projects:ttb1 [2023/09/16 20:50] (current) – [REMOVING A NODE FROM THE LIST] jwieland | ||
---|---|---|---|
Line 72: | Line 72: | ||
<code c> | <code c> | ||
- | | + | |
- | | + | |
- | | + | |
while(current!=NULL){ | while(current!=NULL){ | ||
if (current_node-> | if (current_node-> | ||
if(previous==NULL){ | if(previous==NULL){ | ||
- | node we want to delete from the list is the first node in the list | + | |
*start-of-list =current-> | *start-of-list =current-> | ||
} else{ | } else{ | ||
- | set the previous node's pointer to the current node's pointer | + | |
} | } | ||
free(current) | free(current) |