Write a program to to print the elements from given input by using the one of the Iterator interface methods.
Input (LinkedList) |
Printed Output |
[Cat, Rabbit, Mouse, Lion, Tiger] |
Cat Rabbit Mouse Lion Tiger |
[Rose, Jasmine, Lotus, Peacock, Cassia] |
Rose Jasmine Lotus Peacock Cassia |
[Suman, Sukumar, Sekhar, Praneeth, Prakash] |
Suman Sukumar Sekhar Praneeth Prakash |
null |
null |