Changed print tree method to print linked list of line numbers using an iterator - O(N) vs. O(N^2) time with a for loop