题目: Given a string, find the length of the longest
substring without repeating characters. For example, the longest substring
without repeating letter...
分类:
其他好文 时间:
2014-04-30 21:15:32
阅读次数:
511
2014-04-28
23:52题目:设计算法,找出一本书中某个单词的出现频率。解法:数就行了。代码: 1 // 17.9 Given a book, find out the
occurrences of any given words in it. 2 // Answer: 3 // 1....
分类:
其他好文 时间:
2014-04-29 16:00:32
阅读次数:
388
先确保本地Linux服务器SSH服务开启,如果没有开启直接执行指令:service sshd
start然后我们使用ssh指令进行远程登陆ssh username@ip-address输入passwd指令修改旧密码修改默认账号rootvi
/etc/passwd按i键进入编辑状态修改第1行第1个ro...
分类:
系统相关 时间:
2014-04-29 15:51:22
阅读次数:
586
2014-04-29
00:04题目:给定一个整数数组,找出所有加起来为指定和的数对。解法1:可以用哈希表保存数组元素,做到O(n)时间的算法。代码: 1 // 17.12
Given an array of integers and target value, find all pairs in ...
分类:
其他好文 时间:
2014-04-29 15:08:13
阅读次数:
469
2014-04-29
03:05题目:给定一个词典,其中某些词可能能够通过词典里其他的词拼接而成。找出这样的组合词里最长的一个。解法:Leetcode上有Word
Break这道题,和这题基本思路一致。代码: 1 // 18.7 Given a list of words, find out the...
分类:
其他好文 时间:
2014-04-29 14:30:17
阅读次数:
493
2014-04-29
02:27题目:找出10亿个数中最小的100万个数,假设内存可以装得下。解法1:内存可以装得下?可以用快速选择算法得到无序的结果。时间复杂度总体是O(n)级别,但是常系数不小。代码:
1 // 18.6 Find the smallest one million number....
分类:
其他好文 时间:
2014-04-29 14:27:13
阅读次数:
665
转载http://blog.csdn.net/luxiaoyu_sdc/article/details/6458872一般程序崩溃可以通过debug,找到程序在那一行代码崩溃了,最近编一个多线程的程序,都不知道在那发生错误,多线程并发,又不好单行调试,终于找到一个比较好的方法来找原因,通过生成map...
分类:
其他好文 时间:
2014-04-29 10:38:46
阅读次数:
394
题目: There are two sorted arrays A and B of size m
and n respectively. Find the median of the two sorted arrays. The overall run
time complexity should...
分类:
其他好文 时间:
2014-04-29 10:32:46
阅读次数:
359
List的几个方法List=>List.Find()List.FindAll()List.Contains()
List.ForEach()List.ConvertAll() 1. 先比较Find()跟FindAll()。 这个两个函数都是 遍历List的集合,只是
区别在于FindAll()返回的...
分类:
Web程序 时间:
2014-04-29 10:32:46
阅读次数:
443
函数指针typedef void (*lpFunction)();
//定义一个无参数、无返回类型的函数指针类型lpFunction lpReset = (lpFunction)0xF000FFF0;
//定义一个函数指针指向CPU启动后所执行的第一条指令的位置lpReset(); //调用软重启函...
分类:
其他好文 时间:
2014-04-29 10:13:45
阅读次数:
373