User Tools

Site Tools


notes:data:fall2023:projects:ttb1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:data:fall2023:projects:ttb1 [2023/09/16 20:48] – [REMOVING A NODE FROM THE LIST] jwielandnotes: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>
-  deleteBrick(Brick** start-of-list, int x, int y) { +  deleteNode(Node** start-of-list, int x, int y) { 
-  Brick* current =*start-of-list; +  Node* current =*start-of-list; 
-  Brick* previous= NULL;+  Node* previous= NULL;
   while(current!=NULL){   while(current!=NULL){
     if (current_node->x == x && current_node->y == y) {     if (current_node->x == x && current_node->y == y) {
       if(previous==NULL){       if(previous==NULL){
-        node we want to delete from the list is the first node in the list+        //node we want to delete from the list is the first node in the list
         *start-of-list =current->next;         *start-of-list =current->next;
       } else{       } else{
-        set the previous node's pointer to the current node's pointer+        //set the previous node's pointer to the current node's pointer
       }       }
       free(current)       free(current)
notes/data/fall2023/projects/ttb1.1694897311.txt.gz · Last modified: 2023/09/16 20:48 by jwieland