0

Java.linked list

How I can get output 4 5 instead of : 5 4 https://code.sololearn.com/cpBUSc0uJTRO/?ref=app

27th Feb 2021, 9:43 AM
Ruslan
1 Answer
+ 1
use ListIterator, then you could reverse iterate: public void print() { ListIterator list = l.listIterator(l.size()); while (list.hasPrevious()) { System.out.println(list.previous()); } }
27th Feb 2021, 12:25 PM
visph
visph - avatar