diff options
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"); } |
