摘要:
When we get this problem, we need to confirm the following 2 questions: 1. Can root, p or q be null? (No) 2. Are both p and q in the tree (No, either 阅读全文
posted @ 2022-02-08 07:36
阳光明媚的菲越
阅读(21)
评论(0)
推荐(0)
摘要:
When we get this problem, we need to confirm the following 3 questions: 1. Can root, p or q be null? (No) 2. Are both p and q in the tree (yes) 3. Can 阅读全文
posted @ 2022-02-08 06:30
阳光明媚的菲越
阅读(19)
评论(0)
推荐(0)
摘要:
Although this is an easy question, but it is prone to bugs, and the code can be better. Following is my first solution, didn't use the feature of BST. 阅读全文
posted @ 2022-02-08 04:38
阳光明媚的菲越
阅读(22)
评论(0)
推荐(0)
摘要:
For sparse venctors, there might be too many "0"s in the array. What we need to do is only abstract the items which are not "0". We store these non-ze 阅读全文
posted @ 2022-02-08 04:13
阳光明媚的菲越
阅读(36)
评论(0)
推荐(0)
摘要:
My first solution is use two skacks, one stack store index, another one store value, the time complexity is O(n). public int[] findBuildings(int[] hei 阅读全文
posted @ 2022-02-08 01:29
阳光明媚的菲越
阅读(49)
评论(0)
推荐(0)
浙公网安备 33010602011771号