
CTCI
文章平均质量分 76
seemuch
这个作者很懒,什么都没留下…
展开
-
[CTCI] 4.6 First Common Ancestor for Two Nodes On a Binary tree
问题:Design an algorithm and write code to find the first common ancestor of two nodes in a binary tree. Avoid storing additional nodes in a data structure. NOTE: This is not necessarily a binary sear原创 2014-01-23 18:36:23 · 868 阅读 · 0 评论 -
[CTCI] 5.2 Convert Decimal to Binary
问题:Given a (decimal - e.g. 3.72) number that is passed in as a string, print the binary representation.If the number can not be represented accurately in binary, print “ERROR”.分析:我们这里暂时不考虑负数原创 2014-01-26 01:19:58 · 1068 阅读 · 0 评论