Question: Task 2 - Implementing a Linked List 15 points For this task, you will need to complete the implementation of the following five member functions


Task 2 - Implementing a Linked List 15 points For this task, you will need to complete the implementation of the following five member functions of Class List. The partial implementation of this class is provided in the same folder as this homework instructions. bool isEmpty returns true if the list is empty; it returns false otherwise. [2 points] int findKth (int pos) returns the element at position pos. If the position pos is greater than the size of the list, return 0. [5 points] int find (int value) returns the position of the first occurrence of value, if the element cannot be found, return 0. 4 points] int front returns the data of the first element, if the list is empty return 0. [2 points] int back returns the data of the last element, if the list is empty return 0. [2 points] The main0 function in the file instantiates a linked list (named myList) and invokes several functions of the linked list. After completing all the member functions above, your output should look like this when the program runs: myList is empty? true Size is :0 First element is :0 Last element is :0 myList is empty? false Size is :5 First element is :10 Last element is :50 myList is empty? false Size is :10 First element is :10 Last element is :100 100 is at position :10 10 is at position 1 60 is at position :6 120 is at position :0 Data at position 2 is :20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
