Write a procedure that deletes all odd numbers from a linked list of integers.
Write a procedure that takes a linked list and inserts a duplicate copy of every node. For example, if the list is 3 → 4 → 6 → nil, it should become 3 → 3 → 4 → 4 → 6→ 6 → nil.
Write a procedure that takes a linked list and collapses any adjacent duplicates. In other words, if a series of adjacent nodes in the list have the same value, the procedure should delete all but one of them.
In the lecture we sketched the implementation of a fixed-size queue backed by a fixed-sized array. Implement this.
In the lecture we also described how to use a resizable array to implement a queue that can grow to any size. Implement this.
Write a function randomTree(h: integer): pnode
that
builds a complete binary tree of height h. Every value in the tree
should be a random integer in the range 0 .. 999.
Write a function completeTree(h: integer): pnode
that
builds a complete binary tree of height h. Every node's value should
be that node's depth.
Write a procedure destroy(p: pnode)
that disposes all
nodes in a binary tree.
Write a procedure mirror(var p: pnode)
that flips a
tree from left to right so that it looks like a mirror image of the
original tree.
Write a function equal(p, q: pnode): boolean
that
returns true if two binary trees are identical, i.e. they have the
same structure and the same values in corresponding nodes.
Write a procedure that prints out all values in a binary search tree in increasing order.
Solve Project Euler's problem 11.