Skip to content

Instantly share code, notes, and snippets.

@jianminchen
Created May 9, 2016 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianminchen/cd219738d812605e0c6ced926d2e488c to your computer and use it in GitHub Desktop.
Save jianminchen/cd219738d812605e0c6ced926d2e488c to your computer and use it in GitHub Desktop.
HackerRank - LinkedList - Print a list
/*
Print elements of a linked list on console
head pointer input could be NULL as well for empty list
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
void Print(Node *head)
{
if(head==NULL)
return;
printf("%d\n", head->data);
Print(head->next);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment