摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. (Medium) 分析: 链表不同于数组的是需要先遍历一遍求出长度,然后再找到中 阅读全文
摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. (Medium) 分析: 因为要构成BBST,所以要从中点开始,左边为左子树,右边为右子树,采用help 阅读全文