Initial commit

This commit is contained in:
github-classroom[bot] 2025-04-01 10:41:03 +00:00 committed by GitHub
commit e6e6f4ae94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 8332 additions and 0 deletions

40
queue.c Normal file
View file

@ -0,0 +1,40 @@
/*----------------------------------------------------------
* HTBLA-Leonding / Class: <your class>
* ---------------------------------------------------------
* Exercise Number: S03
* Title: Queue implementation
* Author: */<your name>;/*
* ----------------------------------------------------------
* Description:
* Implementation of a queue based on an advanced singly linked list.
* ----------------------------------------------------------
*/
/*
Implementation notes:
1) The 'QueueData' struct SHALL encapsulate the underlying list
to decouple queue and queue interfaces. No further members are required.
2) Queue allocation:
Use functions `mem_alloc()` and `mem_free()`
declared in `allocator.h`. DO NOT use `malloc()` and `free()` directly
as unit tests will fail.
3) Avoid code duplication wherever (reasonably) possible.
The implemenation of each function mostly delegates
to the corresponding queue function (one-liners).
Implement the combined functionality of 'dequeue' and 'peek'
as a single private function which is used by 'dequeue' and 'peek'.
*/
/* includes */
/** The implementation of queue data */
/* ===================================================================== */
/* private queue functions */
/* ===================================================================== */