Write a program using linkedlist and listiterator to obtain


Question 1:

:*Write a program using LinkedList and ListIterator to obtain the following statements:

1. Create a linked list named "number" with these elements: "one", "four" and "three".

2. Create a List Iterator named "it1" related to "number".

3. Add the new element "two" after the element "one"

4. Remove the element "four"

5. Create a new List Iterator named "it2" related to "number", to add new elements in the

respective positions. To create each new element you must use the value of the current

element concatenated to " and a half".

The new obtained list is:

one

one and a half

two

two and a half

three

three and a half

Question 2 :

*To solve this question, you can use the doubly LinkedList Class from your book, or any other
implementation.
Add the following changes to the doubly LinkedList Class:
1. Override the toString() method.
2. Implement getSize() method, which returns the current size of the linked list (remember
that you need to make core changes to the code)
3. Implement another toString method with the name reverseToString(), this method should
return a string of the data within the linked list but in reverse order.
4. Implement a sort() method to sort LinkedList. You can use any sort algorithm or any trick
to sort LinkedList (think outside the box).
5. The attached LinkedListTester class must work with your implementation.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program using linkedlist and listiterator to obtain
Reference No:- TGS01365419

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)