ECE-C 301 Assignment 3: Stacks, Queues and trees


Due: Tuesday Feb 27, 2008

1. Stacks

Stacks are First In Last Out (FILO) data structures. What that means is that it works like a stack of dishes (duh!). Whatever you put on the top will have to come off first before you can access what's at the bottom. What's at the top is the most recent one put on.

Please implement the following within the Node class from lecture (refer to lecture 7):

2. Queues

Queues are the reverse of stacks in that they are First In First Out (FIFO). It works like a line in the bank or food cart. The first person that gets there is the first served. This is most fair.

Please implement the following within the Node class from lecture:

3. Trees

Within the TreeNode class from lecture (lecture 7) and implement the following: