Copyright ©
2005 Suradet Jitprapaikulsarn
สงวนลิขสิทธิ์ 2548 สุรเดช จิตประไพกุลศาล
Homework 8 (Due 15 August 2005)
- Write a function, nNode, to determine the number of nodes in a ternary tree.
- Write a function, count, to determine the number of occurrences of a number in a ternary tree.
- Write a function, replace, to replace a number in a ternary tree with another number.
- Write a function, range, to determine the range of numbers in a
ternary tree (the difference between the maxinum and the minimum
values)
- (Bonus) Write a function, strictlyBT?, to determine whether a
binary tree is a strictly binary tree. A strictly binary tree has
the following properties:
- For each node of a strictly binary tree, either
- the node has no subtree.
- or the node has both left subtree and right subtree