Java Question Linked List Contains Consecutive Repeated Int Numbers Illustreded Example Wr Q37080512

in java question:

Linked list contains consecutive repeated int numbers asillustreded in example. Write a method shrink()what removesrepeated numbers and leave one copy for each sequence of repeatednumber.

L:6->6->6->6->5->5->5->10->10->10->10->5->5->5->5->3->null

Resultant List after shrink() method

L: 6->5->10->5->3->null


Answer


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.