Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia ...
分类:
编程语言 时间:
2018-12-26 20:24:22
阅读次数:
132
Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, ...
分类:
编程语言 时间:
2018-12-26 20:13:03
阅读次数:
209
http { limit_req_zone $binary_remote_addr zone=perip:30m rate=60r/s; } rate=60r/s 表示处理请求的平均速度(每个请求之间至少要间隔(1000/60≈16.7ms),超出的请求将会进入令牌桶中,例如在10ms内发出5个请求 ...
分类:
其他好文 时间:
2018-12-26 19:58:40
阅读次数:
122
最近在ubuntu 12.04下安装QT的过程中,遇到一个问题。 ./qt-opensource-linux-x64-5.7.0.run出现了bash: ./qt-opensource-linux-x64-5.7.0.run: cannot execute binary file。 我用我自己的解决 ...
分类:
系统相关 时间:
2018-12-25 14:32:02
阅读次数:
376
真的是第一次完全没有看其他参考答案,第一次写出来,而且没有报错,值得庆祝一下。虽然题目很简单,但是我在使用递归时,还是害怕细节出错,ヾ(?°?°?)?? 求二叉树的高度 只要递归下去就可以了 1.map函数的使用,可以简化代码、 2.使用队列可以更加快速 ...
分类:
其他好文 时间:
2018-12-24 17:20:12
阅读次数:
150
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ Given a binary tree, find the lowest common ancestor (LCA) of two given nodes i ...
分类:
其他好文 时间:
2018-12-24 00:02:14
阅读次数:
131
"2973:Skew数" 总时间限制: 1000ms 内存限制: 65536kB 描述 在 skew binary表示中, 第 k 位的值xk表示xk (2k+1 1)。 每个位上的可能数字是0 或 1,最后面一个非零位可以是2, 例如, 10120(skew) = 1 (25 1) + 0 (24 ...
分类:
其他好文 时间:
2018-12-23 11:24:38
阅读次数:
151
Binary search is an algorithm that accepts a sorted list and returns a search element from the list. It provides a dramatic performance boost over sea ...
分类:
编程语言 时间:
2018-12-23 11:10:46
阅读次数:
138
Accumulation Degree 题目链接:http://poj.org/problem?id=3585 Description: Trees are an important component of the natural landscape because of their preven ...
分类:
其他好文 时间:
2018-12-22 22:01:03
阅读次数:
181
贪心...我都好奇自己当时没事干怎么就学了贪心... 当然尽管这样23道题我也没写完... 正如gg所说:我们要不厌其烦地写题解。(当然不存在的 1455:An Easy Problem As we known, data stored in the computers is in binary f ...
分类:
其他好文 时间:
2018-12-22 11:52:35
阅读次数:
254