comparison final_pre/src/SingleLinkedStack.cbc.replace @ 7:28f900230c26

add final_pre
author ryokka
date Mon, 19 Feb 2018 23:32:24 +0900
parents
children
comparison
equal deleted inserted replaced
6:d927f6b3d2b3 7:28f900230c26
1 __code pushSingleLinkedStack(struct Single LinkedStack* stack,union Data* data, __code next(...)) {
2 Element* element = new Element();
3 element->next = stack->top;
4 element->data = data;
5 stack->top = element;
6 goto next(...);
7 }
8 __code popSingleLinkedStack(struct Single LinkedStack* stack, __code next(union Data* data, ...)) {
9 if (stack->top) {
10 data = stack->top->data;
11 stack->top = stack->top->next;
12 } else {
13 data = NULL;
14 }
15 goto next(data, ...);
16 }