Print Linked List

4.6

7 votes
Very-Easy, Very-Easy
Problem

Let's put the learning to use. We already learnt how to traverse a Linked List using a while loop . We have to keep two things in mind:

  1. Take head as the starting reference.

  2. Loop till p is not NULL.

Sanad has a problem, he is a beginner to Linked Lists just like you and he needs your help.

Given a linked list fill the function printList() to print the elements of the list. You have to print each element of the list in a new line.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?