diff paper/src/ex_stack.cbc @ 19:f311c7a14a62 default tip

add src
author mir3636
date Mon, 15 May 2017 18:50:34 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/src/ex_stack.cbc	Mon May 15 18:50:34 2017 +0900
@@ -0,0 +1,12 @@
+__code clearSingleLinkedStack(struct SingleLinkedStack* stack,__code next(...)) {
+    stack->top = NULL;
+    goto next(...);
+}
+
+__code pushSingleLinkedStack(struct SingleLinkedStack* stack,union Data* data, __code next(...)) {
+    Element* element = new Element();
+    element->next = stack->top;
+    element->data = data;
+    stack->top = element;
+    goto next(...);
+}