我有一个作业问题,要求我制作一个从列表末尾开始的列表迭代器。我不知道该怎么做。这是代码
public class LinkedListTester7
{
public static void main(String [] args)
{
LinkedList<Integer> list = new LinkedList<Integer>();
for (int i = 0 ; i < 100 ; i = i + 2)
list.add(i) ;
//-----------Start below here. To do: approximate lines of code = 3
// 1. make a list iterator that starts at the end of the list ;
ListIterator<Integer> litr = list.listIterator();
//2. while hasPrevious ;
while (litr.hasPrevious()) {
//3. print what is returned by previous() followed by …Run Code Online (Sandbox Code Playgroud)