Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
給予一個單向的串列鏈結且元素已經經過漸增排序,將它轉換為高度平衡的二元搜索樹(BST)。
這個問題中,所謂的高度平衡的二元樹被定義為一棵二元樹中所有節點的兩個子樹高度差異不大於一。
LeetCode
C++