Q109. Convert Sorted List to Binary Search Tree
Given the sorted linked list: [-10,-3,0,5,9],
One possible answer is: [0,-3,9,-10,null,5], which represents the following height balanced BST:
0
/ \
-3 9
/ /
-10 5分析
slow fast
| |
-10, -3, 0, 5, 9
| |
head midC++代码
Last updated