1. Design an algorithm that received a binary tree and returns true iff that tree is a binary search tree. Establish the correctness and analyze the running time of your algorithm. 2. Consider the following program operating on disjoint sets over the domain {x1, x2,...,x16}: for i = 1 to 16 do MAKESET(xi) for 1 to 15 by 2 do WIINIONLY, Y.

Question

Question 1

1. Design an algorithm that received a binary tree and returns true iff that tree is a binary search
tree. Establish the correctness and analyze the running time of your algorithm.
2. Consider the following program operating on disjoint sets over the domain {x1, x2,...,x16}:
for i = 1 to 16 do MAKESET(xi)
for 1 to 15 by 2 do WIINIONLY, Y.
Transcribed Image Text:1. Design an algorithm that received a binary tree and returns true iff that tree is a binary search tree. Establish the correctness and analyze the running time of your algorithm. 2. Consider the following program operating on disjoint sets over the domain {x1, x2,...,x16}: for i = 1 to 16 do MAKESET(xi) for 1 to 15 by 2 do WIINIONLY, Y.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer