- You are given a partially written LinkedList class.
- Here is a list of existing functions:
- addLast - adds a new element with a given value to the end of the Linked List
- display - Prints the elements of the linked list from front to end in a single line. All elements are separated by space.
- size - Returns the number of elements in the linked list.
- You are required to complete the body of removeFirst function
- removeFirst - This function is required to remove the first element from Linked List. Also, if there is only one element, this should set head and tail to null. If there are no elements, this should print "List is empty".
- Input and Output are managed for you.
If you have difficulty understanding the problem watch the question video.