Categorygithub.com/szhou12/leetcode-goleetcode0108-Convert-Sorted-Array-to-Binary-Search-Tree
package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev

# README

108. Convert Sorted Array to Binary Search Tree

Solution idea

Recursion

Input array 升序排列,而BST in-order traversal产生升序排列的数组.

故,Key Oberservation: input array的mid就是BST的根结点

Time complexity = $O(\log n)$

Resource

代码随想录-108.将有序数组转换为二叉搜索树