diff options
| author | mo khan <mo.khan@gmail.com> | 2020-07-04 17:47:24 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-07-04 17:47:24 -0600 |
| commit | 8ef8f0e1f1e96f823a3cee027d65a34a3d515ba9 (patch) | |
| tree | 1c8091ecbb6430d012e27232c1c565da17685b34 /src/01/02a/singly_linked_list.c | |
| parent | 29aa26f5fdc7d53d5fbead6347f6962288039639 (diff) | |
Add program output to the program profile
Diffstat (limited to 'src/01/02a/singly_linked_list.c')
| -rw-r--r-- | src/01/02a/singly_linked_list.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/01/02a/singly_linked_list.c b/src/01/02a/singly_linked_list.c index e251b68..2271965 100644 --- a/src/01/02a/singly_linked_list.c +++ b/src/01/02a/singly_linked_list.c @@ -103,15 +103,15 @@ void swap(Node **head, int x, int y) { * A helper method used to print a visual representation * of a linked list * - * @param node The head of the linked list + * @param self The head of the linked list */ -void inspect(Node *node) { - if (!node) return; +void inspect(Node *self) { + if (!self) return; - printf("*******\n"); - while (node) { - printf("\t%d\n", node->data); - node = node->next; + printf("["); + while(self) { + printf(" %d ", self->data); + self = self->next; } - printf("*******\n"); + printf("]\n"); } |
