摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11... 阅读全文
posted @ 2012-11-14 17:00 程序员杰诺斯 阅读(111) 评论(0) 推荐(0)
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.由于链表不能随机访问,只能修改链表结构,要不就只能... 阅读全文
posted @ 2012-11-14 16:41 程序员杰诺斯 阅读(96) 评论(0) 推荐(0)
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.平分,递归。/** * Definition for binary tre... 阅读全文
posted @ 2012-11-14 16:32 程序员杰诺斯 阅读(89) 评论(0) 推荐(0)
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such th... 阅读全文
posted @ 2012-11-14 16:13 程序员杰诺斯 阅读(120) 评论(0) 推荐(0)
摘要: Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree... 阅读全文
posted @ 2012-11-14 15:14 程序员杰诺斯 阅读(97) 评论(0) 推荐(0)