diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-05-27 04:26:00 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-05-27 04:26:00 -0400 |
commit | 533d7755f866257c78299561b2634a3ea54f9a87 (patch) | |
tree | 0f9f42939e0551da927f3ca5e1f7f18d3daf3c61 | |
parent | a89e4d56a242073982ca3620a00c6e04bf5e82d8 (diff) |
Add print function for double ended queue.
Moves original print to debug_print.
-rw-r--r-- | collections/double_ended_queue.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/collections/double_ended_queue.c b/collections/double_ended_queue.c index fab92c7..29c8873 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -178,7 +178,22 @@ deq *root; free(root); } -void deq_print(root) +void deq_print(root, to_string) +deq *root; +char* to_string(void*); +{ + int i, size;; + + size = deq_size(root); + + printf("["); + for (i = 0; i < size; i++) { + printf("%s,", to_string(deq_index(root, i))); + } + printf("\b]\n"); +} + +void deq_debug_print(root) deq *root; { void **tmp; |