Skip to content

Instantly share code, notes, and snippets.

@visparashar
Created July 23, 2017 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save visparashar/f7c9d94ad163af6d11665c20766a39ff to your computer and use it in GitHub Desktop.
Save visparashar/f7c9d94ad163af6d11665c20766a39ff to your computer and use it in GitHub Desktop.
class LinkedListOperations {
public static void main(String[] args) {
LinkedList list = new LinkedList();
list.insert(1);
list.insert(2);
list.insert(4);
list.insert(3);
list.insert(5);
list.show();
list.delete(2);
list.delete(4);
list.show();
list.insertAtFirst(9);
list.show();
list.insertAfter(3,4);
list.show();
list.insertAfter(5,6);
list.show();
list.deleteAtPosition(3);
list.show();
list.deleteAtPosition(1);
list.show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment