Operating Systems
and Computer Structures G2
Tutorial Exercises, Week 7, 1996
-
Devise an appropriate data structure for a binary tree of integers.
Using this,
-
Write a function in C to determine the number of nodes in the tree.
-
Write a function in C to determine the height of the tree.
-
Write a function in C to destroy the tree, reclaiming all space used.
-
Write a function that behaves like strchr() i.e. that takes a string and a
character, and returns a pointer to the first occurrence of that
character in the string, or NULL if it is not present.
Then write one that behaves like strrchr() and returns a pointer
to the last occurrence of that character in the string,
or NULL if it is not present.
This page is
http://jan.newmarch.name/OS/tutorials.html,
copyright Jan Newmarch.
It is maintained by Jan Newmarch.
email:
jan@newmarch.name
Web:
http://jan.newmarch.name/
Last modified: 2 August, 1995