Write a class ArrayQueue that implements a fixed-size queue using an array.
Write a class DynamicArrayQueue that implements a dynamically resizing queue using an array.
Write a class LinkedQueue that implements a queue using a linked list.
Write a function max_in_tree(t) that returns the maximum value in a binary tree.
Write a function completeTree(h)
that builds a
complete binary tree of height h. Every node's value should be that
node's depth.
Write a function
mirror(t)
that modifies
a binary tree, flipping it from left to right so that it looks
like a mirror image of the original tree.
Write a function equal(
t,
u
)
that takes two Node objects
representing the roots of two binary trees. The
function should return True if the
binary trees are identical, i.e. they have the same structure
and the same values in corresponding nodes.
Write a function isAncestor(p, q)
that takes pointers
to two nodes p and q in a binary tree and returns true if p is an
ancestor of q.
Solve Project Euler's problem 19.