Mein Teil (Sollte Fertig sein)

This commit is contained in:
schrempfde103950 committed 2026-11-23 21:41:30 +01:00
1 parent e7a872252a
commit 89067a7ba6
4 files changed
+100 -14

No files matched your search

+8 -5
View File
@@ -1,13 +1,16 @@
#ifndef STACK_H
#define STACK_H
#define STACK_H
/* A stack is a special type of queue which uses the LIFO (last in, first out) principle.
This means that with each new element all other elements are pushed deeper into the stack.
The latest element is taken from the stack. */
/* A stack is a special type of queue which uses the LIFO (Last In, First Out) principle.
This means that with each new element all other elements are pushed deeper into the stack.
The latest element is taken from the stack. */
#include <stdlib.h>
//TODO: passenden Datentyp als struct anlegen
typedef struct StackNode {
void *data;
struct StackNode *next;
} StackNode;
// Pushes data as pointer onto the stack.
StackNode *push(StackNode *stack, void *data);