摘要: If the Fibonacci series is 1,2,3,5,8,13,….. then 10 can be written as 8 + 2 ==> 10010 and 17 can be written as 13 + 3 + 1 ==> 100101. Got it?? The Question was, given n, I need to get all possible representations of n in Fibonacci Binary Number System. as 10 = 8 + 2 ==> 10010 also 10 = 5 + 阅读全文
posted @ 2012-11-01 23:16 chkkch 阅读(430) 评论(0) 推荐(1) 编辑
摘要: You have two BST, you have to merge them into a single BST, inplace and linear time.http://www.careercup.com/question?id=8255895其中,一位仁兄给出了一个非常漂亮的解答:we could do it in O(m+n) (m, n sizes of both bsts)1) Covert Tree1 in to circular doubly linked list. O(m)Search for "tree list recursion problem&qu 阅读全文
posted @ 2012-11-01 22:27 chkkch 阅读(435) 评论(0) 推荐(0) 编辑