- 博客(7)
- 资源 (1)
- 问答 (2)
- 收藏
- 关注
原创 OJ 72 Edit Distance
Description: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted o
2017-08-27 17:52:36 385
原创 OJ - 53 Maximum Subarray && 70 - Climbing Stairs
这两个是关于动态规划的题目。53 : Description: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the conti
2017-08-27 14:56:23 296
原创 OJ -338 Counting bits
Description: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array. Ex
2017-08-17 21:37:33 314
原创 对32位的无符号int的位进行操作的一些相关函数
我们有时候会用到对一个32位的位集合来进行操作,比如: 1.设置一个unsigned int 的某一位. 2.得到给定范围内1的个数. 3.把指定的值放入一个整型数里面保存起来,比如RGBA(红,绿,蓝,透明度),这四个参数的取值范围都是0-255,一个unsigned char 类型即可保存一个参数,我们可以用一个unsigned int 类型来保存这四个值。 上面的这些情况就需要使用到位
2017-08-09 14:23:50 992
原创 KMP算法
1.字符串匹配:给定两个字符串S1, S2,我们需要确定S1里面是否包含S2,换句话说就是判断S2是否是S1的子串。 我们很容易想到的方法就是暴力搜索:从第一个字符开始匹配,如果不相等则顺序后移一位,再进行比较,伪代码为:n = s1.sizem = s2.sizefor i = 0 to n - m if s2[0 ... m-1] == s1[s ... s+m-1]
2017-08-09 00:31:04 371
原创 Vim 实用技巧,一些自己常用到的命令
一些命令:1. dd : 删除一行2. yy :复制一行3. v or ctrl + v or shift + v : 选择4.shift + a : 光标移到最后并启动插入模式5.shift + i : 光标移动到开头并启动插入模式6. o : 另起一行,并启动插入模式7. .(句号按键) : 重复执行上一次修改操作8. shift + 8 : 高亮显示光标下的所
2017-08-04 14:54:22 369
原创 OJ 141 --Linked List Cycle
Description:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?描述:给定一个链表,写一个函数确定这个链表是否有环。空间复杂度为O(1)思路:链表有环,则最
2017-08-02 22:28:39 324
qt 连接mysql 遇到的问题
2015-12-22
qt5.5 怎么连接oracle 数据库
2015-12-21
TA创建的收藏夹 TA关注的收藏夹
TA关注的人