Thursday, February 23, 2012

HW: Postfix notation, redux. This time, instead of simply evaluating, we want to build the expression tree.

Homeworks as they are due:
Binary expression tree (part one) -- next Tuesday, Feb 28
Binary expression tree (part two) -- next Thursday, Mar 1
Your stack implements Queue, Mar 6
Array-based Queue, Mar 8

Tuesday, February 14, 2012

Late Homework Guidelines

Each homework is graded on a scale from 0 to 5.

For each day late, 0.5 is deducted from the total possible score for that homework.

The first few (four) homeworks are due this Thursday.

Tuesday, February 7, 2012

lecture 3


I described up to postfix using arrays assignment (#4).

int x[] = new int[100];

for (int i = 0; i< x.length; i++)
System.out.println(x[i]);

for (int p : x)
System.out.println(p);

interfaces
Iterable
Iterator

when I implement Iterable, I must provide a
method called iterator()

iterator returns Iterator

anything implementing Iterator must provide
boolean hasNext()

next()

int x[] = new int[100];
Iterator i = x.iterator();
while(i.hasNext())
{
int p = i.next();
System.out.println(p);
}


syntactic sugar