Update later...
- Example with Singly Linked List
- By Nguyen Anh Tuan, view more
- Example with Doubly Linked List
- By Nguyen Anh Tuan, view more
- Example with Circular Linked List
- By Nguyen Anh Tuan, view more
*Note: LinkedList always has default constructor and arguments constructor.
- Create a linked list class whose Nodes have a data part is integer type and it has a print method. Initialize 5 linked list instances and print their element’s data to console.
- Create a linked list class whose Nodes have a data part is Point (Point is a class that has 2 private properties indicating for coordinate) and it has a print method. Initialize a linked list instance and print its element’s data to console.
- Create a linked list class whose Nodes have a data part is integer type and it has print, insertLast, insertFirst methods. Declare a linked list instance, then add numbers of random int numbers and print its element’s data to console.
- Create a linked list class similar to question 3, but Its Nodes’ data part is Point type. Initialize a linked list instance, then add numbers of random Points and print its element’s data to console.
- Create a generic linked list class has print, insertLast, insertFirst methods. Initialize a number type linked list instance and add numbers of random Points to a declared Point type linked list instance that are generated from generic linked list class and print their element’s data to console.
- Create an int (number) linked list class has print, insertLast, insertFirst, insertAt. Initialize a linked list instance to perform all of its methods.
Note: print, insertLast, insertFirst and insertAt methods are required in LinkedList now.
- Create an int (number) linked list class has required methods, removeLast, removeFirst and removeAt. Declare a linked list instance and add numbers of random numbers and perform all of its methods.
- Create an int (number) linked list class has getAt method. Initialize a linked list and perform getAt method.
- Create an int (number) linked list class has insertByOrder method. Declare a linked list and add numbers of random numbers with insertByOrder.
- Create an int (number) linked list class has all methods that are mentioned in every previous question. Declare a doubly linked list and perform all of its methods.
Note: removeLast, removeFirst, removeAt, getAt and insertByOrder methods are required in LinkedList now too.
- Create a generic linked list class, a Point class with x and y properties and a Person class with name, age properties. Use generic linked list class to declare 2 linked lists
- Point Linked List: add 2 points with insertFirst, 2 points with insertLast, 2 points with insertAt and 2 points with insertByOrder. Get arbitrary 4 points with getAt. Then remove tail, remove head, remove a random point.
- Person Linked List: add 2 people with insertFirst, 2 people with insertLast, 2 people with insertAt and 2 people with insertByOrder. Get arbitrary 4 people with getAt. Then remove tail, remove head, remove 2 random people.
- Create a generic doubly linked list class has the same methods as the generic singly linked list class in Question 11 and 2 two classes Point and Person. Use generic doubly linked list class to declare 2 doubly linked lists and do tasks like Question 11.