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

Homework 8 (Due 15 August 2005)

  1. Write a function, nNode, to determine the number of nodes in a ternary tree.
  2. Write a function, count, to determine the number of occurrences of a number in a ternary tree.
  3. Write a function, replace, to replace a number in a ternary tree with another number.
  4. Write a function, range, to determine the range of numbers in a ternary tree (the difference between the maxinum and the minimum values)
  5. (Bonus) Write a function, strictlyBT?, to determine whether a binary tree is a strictly binary tree.  A strictly binary tree has the following properties: