108. Convert Sorted Array to Binary Search Tree

time: O(n), must visit all nums element

space: O(n), must build all nums element, O(logn) for recursion stack, because use binary search idea

Last updated

Was this helpful?