daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     @Override
  2.     public T[] toArray(){
  3.         int indice = 0;
  4.         T[] result = (T[]) new Object[size()];
  5.         toArrayRecursive(result, this, indice);
  6.         return result;
  7.     }
  8.    
  9.     private void toArrayRecursive(T[] result, RecursiveSingleLinkedListImpl<T> node, int indice){
  10.         if(!node.isEmpty()){
  11.             result[indice] = node.data;
  12.             indice ++;
  13.             toArrayRecursive(result, node.next, indice);
  14.         }
  15.     }
RAW Paste Data
Top