diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-02-23 14:21:16 -0500 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-02-23 15:00:17 -0500 |
commit | 25395399f6a2822042a445fd6c812566d36dc3f9 (patch) | |
tree | 24fc942aaec0d493f01774f41b7199744f071c13 /collections/double_ended_queue.c | |
parent | 995f7838c0d47b3f4974e8bf501daf1d1f5e247f (diff) |
Add front/back access functions for double ended queue
Diffstat (limited to 'collections/double_ended_queue.c')
-rw-r--r-- | collections/double_ended_queue.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/collections/double_ended_queue.c b/collections/double_ended_queue.c index 1f18330..ac9c131 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -192,3 +192,23 @@ int size; root->end = root->beg + size; } + +void* deq_front(root) +deq *root; +{ + if (!root) { + return; + } + + return *root->beg; +} + +void* deq_back(root) +deq *root; +{ + if (!root) { + return; + } + + return *root->end; +} |