baum
diff baum.c @ 10:0e15841ae111
s/list/stack/g because thats what it is
author | meillo@marmaro.de |
---|---|
date | Sat, 09 Feb 2008 16:49:29 +0100 |
parents | c020b0d1cfca |
children | 8e34daa80f64 |
line diff
1.1 --- a/baum.c Sat Feb 09 16:41:41 2008 +0100 1.2 +++ b/baum.c Sat Feb 09 16:49:29 2008 +0100 1.3 @@ -16,7 +16,7 @@ 1.4 1.5 1.6 struct Node* root = 0; 1.7 -struct Listitem* list = NULL; 1.8 +struct Stackitem* stack = NULL; 1.9 1.10 1.11 void logit(char* text) { 1.12 @@ -108,22 +108,22 @@ 1.13 1.14 1.15 void push(struct Node* node) { 1.16 - struct Listitem* tmp; 1.17 - struct Listitem* new; 1.18 - new = (struct Listitem*) malloc(sizeof(struct Listitem)); 1.19 + struct Stackitem* tmp; 1.20 + struct Stackitem* new; 1.21 + new = (struct Stackitem*) malloc(sizeof(struct Stackitem)); 1.22 new->node = node; 1.23 - tmp = list; 1.24 - list = new; 1.25 - list->next = tmp; 1.26 + tmp = stack; 1.27 + stack = new; 1.28 + stack->next = tmp; 1.29 } 1.30 struct Node* pull() { 1.31 - if (list == NULL) { 1.32 + if (stack == NULL) { 1.33 return NULL; 1.34 } 1.35 - struct Listitem* tmp; 1.36 + struct Stackitem* tmp; 1.37 struct Node* node; 1.38 - tmp = list; 1.39 - list = list->next; 1.40 + tmp = stack; 1.41 + stack = stack->next; 1.42 node = tmp->node; 1.43 free(tmp); tmp=0; 1.44 return node;