All pastes #804281 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-03 09:36 UTC
rendered paste body
    private static Person[] getForefathersRecursiveHelper(int n, Person p){
            
            Person[] arr = new Person[n];
            boolean isTrue = false;
            int arrayCounter = n;
            
            while(isTrue == false) {
                if (p.getFather() == null) {
                    isTrue = true;
                }else{
                    // More fathers to be found, increase counter
                    p = p.getFather();
                    arrayCounter ++;
                }
            }
            
            System.out.println("Array Counter: " + arrayCounter);

            return arr;
        
    }