自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (2)
  • 收藏
  • 关注

原创 多线程信号量的使用

公司业务上写了一个小模块,其中有一个功能是需要等待一个线程执行完一个函数之后,在另一个线程做出反应。之前自己的写法是使用一个循环不断的去监视一个标志值,当标志值变化时候,代表执行完毕。但是这么做的话有一些缺陷,一个是不Sleep的话,那么占用很高的CPU使用率,显然不可行。Sleep的话,则该模块效率提不上来,就算是仅仅1MS,那么模块的速率就降到了一秒100以内了,是不可以被接受的。陷入

2016-05-31 21:15:53 556

原创 LeetCode OJ9. Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.%3 分解出所有元素后放入vector,每个值中间插入一个1,这样所有的都会变成奇数个。然后从中间开始 循环判断是否符合要求class Solution {public: bool isPalindrome(int x)

2016-02-28 19:45:02 210

原创 LeetCode OJ 8.String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca

2016-02-28 19:23:49 221

原创 LeetCode OJ 7. Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -32137.52% 直接用long来转换,转换后判断是否越界。class Solution {public: int reverse (int x) {

2016-02-28 13:21:03 198

原创 LeetCode OJ 6.ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I

2016-02-28 13:19:57 286

原创 LeetCode OJ 5.Longest Palindromic Substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.寻找最长回文串有更长

2016-02-28 13:18:03 220

原创 LeetCode OJ 4.Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).思路就是两个合并cla

2016-02-28 13:17:05 277

原创 LeetCode OJ 3.Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For

2016-02-28 13:07:38 184

原创 LeetCode OJ 2.Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

2016-02-28 13:06:29 230

原创 LeetCode OJ 1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nums

2016-02-28 12:59:49 179

原创 C++ primer 初学

基本语言const 把一个变量转换成一个常量,防止被修改。const int buf=512extern 声明 则未初始化 除非初始化 才可被看为定义extern int i=1;引用 实际上对 refval操作,就是对ival操作 refval只是它的另外一个名字int ival=1024;int &refval=ival;typedeftypedef double wages; // wage

2015-04-14 21:53:47 201

支持vs2017的vax插件visual assist x 2214破解

visual assist x 2114 破解,替换对应目录 下的va_x.dll就可以了。 非飘云阁版本。

2017-09-29

Effective STL 中文版

CSDN上大部分资源排版都有问题。这个没有问题、

2017-08-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除