Question: Create an Object of the SList class. ( b ) Insert the following integer numbers in the list using the addFirst method. { 2 ,

Create an Object of the SList class.
(b) Insert the following integer numbers in the list using the addFirst method.
{2,3,4,7,9}
(c) Print the elements in the linked list.
(d) Insert the following integer numbers in the list using the addLast method.
{15,7,12,8,10}
(e) Print the elements in the linked list.
(f) Remove the first element from your linked list.
(g) Print the elements in the linked list.
(h) Print the number of elements in the linked list (size).
(i) Print the index (position) of the first occurrence of (7) using the findIndex method from 1.a
(j) Print the index (position) of the first occurrence of (25) using the findIndex method from 1.a
(k) Remove the last element from your linked list.
(l) Print the elements in the linked list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!