Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.*;
  3. class Question2b
  4. {
  5.    
  6.     public static void main(String[] args)
  7.     {
  8.          
  9.         int number = 14;
  10.        
  11.         LispList<Integer> Lista = LispList.empty();
  12.         int[] testArray = {7,3,8,12,9,14};
  13.        
  14.         boolean get = getSize(Lista,number,testArray);
  15.        
  16.         System.out.println(get);
  17.        
  18.     }
  19.    
  20.     public static boolean getSize(LispList<Integer> a, int b, int[] c)
  21.     {
  22.        
  23.     for(int i = c.length-1; i>=0; i--)
  24.     {
  25.        a = a.cons(c[i]);  
  26.        System.out.println(a);
  27.     }
  28.    
  29.     for(int i = c.length-1; i>=0; i--)
  30.     {
  31.          if(a.equals(b))
  32.            {
  33.               return true;
  34.                
  35.            }  
  36.     }
  37.      
  38.         return false;
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement