摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *//** * Definition for binary tree * str... 阅读全文
posted @ 2013-07-11 21:06
冰点猎手
阅读(164)
评论(0)
推荐(0)
摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; ... 阅读全文
posted @ 2013-07-11 20:45
冰点猎手
阅读(278)
评论(0)
推荐(0)