摘要:
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target.Note:Given target value is a floating... 阅读全文
posted @ 2015-12-24 13:14
neverlandly
阅读(324)
评论(0)
推荐(0)
摘要:
If I choose / as spliter, how to ensure the other / wouldn't be seen as spliter? The idea is to store length of the str This one will be encoded as "6 阅读全文
posted @ 2015-12-24 12:27
neverlandly
阅读(452)
评论(0)
推荐(0)
摘要:
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:Given target value is a floating... 阅读全文
posted @ 2015-12-24 09:47
neverlandly
阅读(294)
评论(0)
推荐(0)
摘要:
Best Solution: Bit manipulation The basic idea is to use XOR operation. We all know that a^b^b =a, which means two xor operations with the same number 阅读全文
posted @ 2015-12-24 08:50
neverlandly
阅读(276)
评论(0)
推荐(0)
摘要:
This problem can be solved by using union find, reference this blog:https://segmentfault.com/a/1190000003791051 复杂度 时间 O(N^M) 空间 O(N) 思路 判断输入的边是否能构成一个 阅读全文
posted @ 2015-12-24 02:58
neverlandly
阅读(1008)
评论(0)
推荐(0)