Convert Sorted List to Binary Search Tree
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { val = x; next = null; } 7 * } 8 */ 9 /**10 ... 阅读全文
posted @ 2013-09-12 14:46 Step-BY-Step 阅读(462) 评论(0) 推荐(0) 编辑