Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- // TODO code application logic here
- Element e1 = new Element("1", null);
- Element e2 = new Element("2", null);
- Element e3 = new Element("3", null);
- Element e4 = new Element("4", null);
- Element e5 = new Element("5", null);
- Element e6 = new Element("6", null);
- Element e7 = new Element("7", null);
- Element e8 = new Element("8", null);
- Element e9 = new Element("9", null);
- Element e10 = new Element("10", null);
- MySingleLinkedList MSLL = new MySingleLinkedList();
- MSLL.append(e2);
- MSLL.append(e3);
- MSLL.append(e5);
- MSLL.append(e7);
- MSLL.insertBefore(e4, 2);
- MSLL.insertAfter(e6, 3);
- MSLL.insertAfter(e8, 5);
- MSLL.insertAfter(e10, 6);
- MSLL.insertBefore(e9, 7);
- MSLL.prepend(e1);
- MSLL.display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement