Advertisement
ZazoTazo

Untitled

Aug 24th, 2020
2,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         // TODO code application logic here
  3.         Element e1 = new Element("1", null);
  4.         Element e2 = new Element("2", null);
  5.         Element e3 = new Element("3", null);
  6.         Element e4 = new Element("4", null);
  7.         Element e5 = new Element("5", null);
  8.         Element e6 = new Element("6", null);
  9.         Element e7 = new Element("7", null);
  10.         Element e8 = new Element("8", null);
  11.         Element e9 = new Element("9", null);
  12.         Element e10 = new Element("10", null);
  13.         MySingleLinkedList MSLL = new MySingleLinkedList();
  14.        
  15.         MSLL.append(e2);
  16.         MSLL.append(e3);
  17.         MSLL.append(e5);
  18.         MSLL.append(e7);
  19.         MSLL.insertBefore(e4, 2);
  20.         MSLL.insertAfter(e6, 3);
  21.         MSLL.insertAfter(e8, 5);
  22.         MSLL.insertAfter(e10, 6);
  23.         MSLL.insertBefore(e9, 7);
  24.         MSLL.prepend(e1);
  25.         MSLL.display();
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement