lectureCode-sp18/exercises/lists1/Lists1Exercises.java
public int iterativeSize() {
        IntList p = this;
        int totalSize = 0;
        while (p != null) {
            totalSize += 1;
            p = p.rest;
        }
        return totalSize;
    }
/** Return the size of the list using no recursion! */
Return the size of the list using no recursion!
Return the size of the list using no recursion!
public int iterativeSize() {
        IntList p = this;
        int totalSize = 0;
        while (p != null) {
            totalSize += 1;
            p = p.rest;
        }
        return totalSize;
    }
public int iterativeSize ( ) { IntList p = this ; int totalSize = 0 ; while ( p != null ) { totalSize += 1 ; p = p . rest ; } return totalSize ; }
Return the size of the list using no recursion!
Return the size of the list using no recursion!