Minimal Tree
Given a sorted (ascending) array with unique integer elements, write an algorithm to create a binary search tree with minimal height.
Example:
Input: [1, 2, 3, 4, 5, 6, 7]
4
/ \
2 6
/ \ / \
1 3 5 7
Return the height of the resulting tree (for testing purposes).
Hints
solution.py
Python ready
Test Output
▶
Click "Run Tests" to execute your code