SHARE
TWEET

Untitled

a guest Jan 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2.  
  3. public class InvertiLista {
  4.    
  5.     public static LinkedList<Integer> invertiLista(ListIterator<Integer> li)
  6.         {
  7.             if ( li.hasNext() )
  8.                 {
  9.                     int x = li.next();
  10.                     LinkedList<Integer> result = invertiLista(li);
  11.                     result.add(x);
  12.                     return result;
  13.                 }
  14.             else
  15.                 {   return new LinkedList<Integer>(); }
  16.         }
  17.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top