Tree/convert_sorted_array_to_bst library

🌳 Convert Sorted Array to Balanced BST

Builds a height-balanced binary search tree from a sorted array.

Time complexity: O(n) Space complexity: O(log n)

Example:

final arr = [-10, -3, 0, 5, 9];
final root = sortedArrayToBST(arr);

Functions

sortedArrayToBST<T extends Comparable>(List<T> arr) → BinaryTreeNode<T>?