Answer
See the explanation
Work Step by Step
Here's a simple algorithm to create a binary search tree with minimal height for a sorted array of integers:
```python
class TreeNode:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def sorted_array_to_bst(arr):
if not arr:
return None
mid = len(arr) // 2
root = TreeNode(arr[mid])
root.left = sorted_array_to_bst(arr[:mid])
root.right = sorted_array_to_bst(arr[mid+1:])
return root
# Example usage:
sorted_array = [1, 2, 3, 4, 5, 6, 7]
bst_root = sorted_array_to_bst(sorted_array)
```
This algorithm recursively divides the sorted array into two halves, with the middle element as the root of the current subtree. The left and right halves are then processed recursively, ensuring a balanced binary search tree with minimal height.