摘要: TCP三次握手四次挥手 标志位缩写 全称 中文 SYN synchronous 建立联机 ACK acknowledgement 确认 PSH push 传送 FIN finish 结束 RST reset 重置 URG urgent 紧急 ... 阅读全文
posted @ 2017-04-18 21:25 紫魔戒 阅读(154) 评论(0) 推荐(0)
摘要: DescriptionGiven n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance bet... 阅读全文
posted @ 2017-04-16 17:50 紫魔戒 阅读(110) 评论(0) 推荐(0)
摘要: Description Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in b... 阅读全文
posted @ 2017-04-09 17:02 紫魔戒 阅读(109) 评论(0) 推荐(0)
摘要: DescriptionSuppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the... 阅读全文
posted @ 2017-03-31 16:40 紫魔戒 阅读(136) 评论(0) 推荐(0)
摘要: DescriptionAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. E... 阅读全文
posted @ 2017-03-26 23:54 紫魔戒 阅读(98) 评论(0) 推荐(0)
摘要: DescriptionGiven an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’... 阅读全文
posted @ 2017-03-19 20:11 紫魔戒 阅读(114) 评论(0) 推荐(0)
摘要: #include "limits.h"#include "math.h"int abs(int number){ int const mask = number >> (sizeof(int) * CHAR_BIT - 1); return (number + mask)... 阅读全文
posted @ 2017-03-12 16:06 紫魔戒 阅读(336) 评论(0) 推荐(0)
摘要: 338. Counting BitsDescriptionGiven a non-negative integer number num. For every number i in the range 0 ≤ i ≤ num calculate the number of 1’s ... 阅读全文
posted @ 2017-03-11 11:53 紫魔戒 阅读(118) 评论(0) 推荐(0)
摘要: vector–C++ STL 学习vector对应的数据结构为数组,而且是动态数组,也就是说我们不必关心该数组事先定义的容量是多少,它的大小会动态增长。与数组类似的是,我们可以在末尾进行元素的添加和删除,也可以进行元素值的随机访问和修改。 vector是STL中最常见的容器,它... 阅读全文
posted @ 2017-03-05 21:36 紫魔戒 阅读(163) 评论(0) 推荐(0)
摘要: 53. Maximum Subarraymy program:class Solution {public: int maxSubArray(vector& nums) { int result = nums[0]; int sum = 0; ... 阅读全文
posted @ 2017-03-01 12:54 紫魔戒 阅读(90) 评论(0) 推荐(0)