feat(queue): introduce a queue ds, internally this is just a stack...

the only actual difference is a oneline change which makes pushing
append instead of prepend the new data.
This commit is contained in:
Squibid 2025-11-17 17:51:57 -05:00
parent 9daffd4ed1
commit 758edf9d30
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 93 additions and 1 deletions

View file

@ -45,7 +45,7 @@ ds_hmp_free(&hmp, NULL);
free(b);
```
## Stack
## Stack / Queue
```c
char *a = "a";
char *b = "b";
@ -58,6 +58,9 @@ ds_stack_pop(stack); // "b"
ds_stack_pop(stack); // "a"
free(stack);
```
If you need a queue just use the equivalent `ds_queue` functions and datatypes.
Internally a queue is just a stack which pushes to the end instead of the
beginning.
# TODO
- [ ] more data structures