import java.io.*;
import java.util.*;
class Slip29
{
public static void main(String ar[]) throws IOException
{
int n;
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
System.out.print("\t\t Enter the size of Linked List ");
n= Integer.parseInt(br.readLine());
LinkedList<Integer> ll = new LinkedList<Integer>();
for(int i=0;i<n;i++)
{
System.out.println("Enter the element ");
ll.add(Integer.parseInt(br.readLine()));
}
Iterator<Integer> it = ll.iterator();
System.out.println(" Contents of Linked List using iterator ");
while(it.hasNext())
System.out.println(" \t " + it.next());
it = ll.iterator();
System.out.println(" List of negative numbers ");
while(it.hasNext())
{
int no=it.next();
if(no<0)
System.out.println("\t" + no);
}
ll.removeLast();
it=ll.iterator();
System.out.println(" Contents of linked list after removing last element... ");
while(it.hasNext())
System.out.println("\t" +it.next());
}
}
Nice to read your article! very informative post .So, please keep posting A dvanced Java Stuff here Thanks man.......
ReplyDeleteWow amazing i saw the article with execution models you had posted. It was such informative. Really its a wonderful article. Thank you for sharing and please keep update like this type of article because i want to learn more relevant to this topic.
ReplyDeleteVMWare Training in Chennai
MSBI Training in Chennai
Amazing blog. Thanks for sharing.
ReplyDeleteJava training in Noida
This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb.
ReplyDeleteThis trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolites festivity to pity. I appreciated what you ok extremely here
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
ReplyDeleteAll are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information,
I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
Java training in Btm layout
Java training in Jaya nagar
Java training in Electronic city
Java training in Chennai
Java training in USA
Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
ReplyDeletehardware and networking training in chennai
hardware and networking training in omr
xamarin training in chennai
xamarin training in omr
ios training in chennai
ios training in omr
iot training in chennai
iot training in omr
Amazing blog. Thanks for sharing.
ReplyDeletedevops-training-in-hyderabad