上一页 1 ··· 18 19 20 21 22
摘要: 题目描述:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lette... 阅读全文
posted @ 2014-12-05 19:13 Sawyer Ford 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 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 sho... 阅读全文
posted @ 2014-12-02 17:28 Sawyer Ford 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t... 阅读全文
posted @ 2014-11-25 21:59 Sawyer Ford 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 快速排序 OR 插入排序 归并排序 堆排序 选择排序 冒泡排序 总结: 参考资料: http://en.wikipedia.org/wiki/Sorting_algorithm 阅读全文
posted @ 2014-11-23 09:47 Sawyer Ford 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 在linux中使用cmake时,遇到了"file download hash mismatch",同时status显示"unsupported protocol"。 google发现问题出在cmake,如同一位网友所言:Based on the error message "unsupported 阅读全文
posted @ 2014-11-19 21:47 Sawyer Ford 阅读(1466) 评论(0) 推荐(0) 编辑
摘要: 1. string to int && int to string 2. 整数1转换成字符串"001" 3. strncpy 参考资料: https://stackoverflow.com/questions/5590381/easiest-way-to-convert-int-to-string- 阅读全文
posted @ 2014-11-10 11:36 Sawyer Ford 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 问题如下: 现有n个不同的整数,如何从中随机选出m个不同的数。(m<=n) 思路: 一提到随机数函数,我们立即想到rand(),此函数使用方法如下: 要取得[a,b)的随机整数,使用 rand()%(b-a) + a; 要取得[a,b]的随机整数,使用 rand()%(b-a+1) + a; 要取得 阅读全文
posted @ 2014-11-09 16:07 Sawyer Ford 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 如何获取某一文件夹下所有文件名,是一个很有意思的问题。网上代码很多,找了个简单的,特此收录。 原文链接如下:http://blog.sina.com.cn/s/blog_670d5f330100lqnm.html 阅读全文
posted @ 2014-11-07 21:34 Sawyer Ford 阅读(1704) 评论(0) 推荐(0) 编辑
摘要: 题目: 有 1000 个一模一样的瓶子,其中有 999 瓶是普通的水,有一瓶是毒药。任何喝下毒药的生物都会在一星期之后死亡。现在,你只有 10 只小白鼠和一星期的时间,如何检验出哪个瓶子里有毒药?下文给出了非常棒的解答,特此收录http://www.matrix67.com/blog/archiv... 阅读全文
posted @ 2014-11-04 21:10 Sawyer Ford 阅读(241) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22