Java Double linked list
Selasa, 15 Juli 2014
Add Comment
class DoubleLink
{
public static void main(String[] args)
{
LinkList theList = new LinkList();
System.out.println("Inztalizing Doble Linked List : ");
theList.insertBack(22);
theList.insertBack(44);
theList.insertBack(66);
theList.insertBack(88);
System.out.print("Display Forward : ");
theList.displayForward();
System.out.print("Display Backward : ");
theList.displayBackward();
System.out.print("");
System.out.print("Delete List from Head");
while( !theList.isEmpty() )
{
Node aLink = theList.deleteFirst();
System.out.println("Deleted");
aLink.displayLink();
System.out.print("");
}
theList.displayForward();
}
}
{
public static void main(String[] args)
{
LinkList theList = new LinkList();
System.out.println("Inztalizing Doble Linked List : ");
theList.insertBack(22);
theList.insertBack(44);
theList.insertBack(66);
theList.insertBack(88);
System.out.print("Display Forward : ");
theList.displayForward();
System.out.print("Display Backward : ");
theList.displayBackward();
System.out.print("");
System.out.print("Delete List from Head");
while( !theList.isEmpty() )
{
Node aLink = theList.deleteFirst();
System.out.println("Deleted");
aLink.displayLink();
System.out.print("");
}
theList.displayForward();
}
}
0 Response to "Java Double linked list"
Posting Komentar