Create a java class mylinkedlist-iterator object reference


Discuss the below code in detail:

Q: Create a Java class MyLinkedList that includes implementation of:

i. int insertSortNoDuplicate(Object object) that will insert an object at correct position in the ascending (increasing) order. The method also will return -1 if the given object already exists in the current list, otherwise returns 0.

ii. Iterator getIterator(int order) that will return an Iterator object reference that will traverse the elements on the current based on the value of order. If the order is 0 then will traverse from head to tail, otherwise it will traverse from tail to head.

iii. void updateList(MyLinkedList otherlist) that will update the current list with a given otherlist. If an element in current list exists in the otherlist then replace (update) it, otherwise insert (add) it using the above insertSortNoDuplicate method.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create a java class mylinkedlist-iterator object reference
Reference No:- TGS01934150

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)