Copyright © 2005 Suradet Jitprapaikulsarn
สงวนลิขสิทธิ์ 2548 สุรเดช จิตประไพกุลศาล

Homework 13 (Due 19 September 2005)

  1. Write a function, isHeap, to determine whether a binary tree is a heap tree.  A heap tree is a binary tree with the following properties:  For each node in a heap tree, all values in the subtrees are less than the value in the node.
  2. (Bonus) Write a function, largestGap, to determine the largest difference between two adjacent nodes in a binary tree.