Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 774 Bytes

README.md

File metadata and controls

12 lines (7 loc) · 774 Bytes

Linkedlist-Practice

MyLinkedList.java implements several functions handling a linked list. There are several things need to be paid attention:

  1. When adding or removing an element, the size of the linked list should be changed accordingly.
  2. When adding, removing or setting an element, we first need to check whether the element is null. We also need to check whether index is out of bounds (lower bound and upper bound both).
  3. When removing an element, we need to consider three cases: the linked list is empty, the linked list has only one element and the linked list has more than one element.

Admittedly, it's a little bit challenging for a careless person like me -^-.

MyLinkedListTester.java is used to test the functions implemented in MyLinkedList.java.