Question 12.1.7: Use an ordered tree to store a function whose domain is a fi......

Use an ordered tree to store a function whose domain is a finite subset of T and whose range is some set U. The operations are: find the value of the function for a given argument; change this value; delete an element from the domain; and add an element to the domain (the value is also provided).

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

We represent the domain using an ordered tree and add one more array

func_val: array [1 . . n] of U;

If val[x] = t and func_val[x] = u, then the function value on t equals u.

Related Answered Questions

Question: 12.2.2

Verified Answer:

By induction over n, we prove that Φ_{n+2} ...
Question: 12.2.1

Verified Answer:

The maximal number of vertices is equal to ...
Question: 12.1.3

Verified Answer:

val [null]  := t; x := root ; while t <> val...
Question: 12.1.2

Verified Answer:

if root = null then begin ..t is not in the tree e...