Initial commit
This commit is contained in:
commit
e6e6f4ae94
69 changed files with 8332 additions and 0 deletions
40
queue.c
Normal file
40
queue.c
Normal 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 */
|
||||
|
||||
/* ===================================================================== */
|
||||
Loading…
Add table
Add a link
Reference in a new issue