上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页
摘要: 题目描述:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: ... 阅读全文
posted @ 2015-07-23 21:30 Sawyer Ford 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 最近在学习Nginx,记录一下自己的学习历程。1.Nginx开发从入门到精通 (淘宝技术团队编写,值得一看)2. 《深入理解Nginx:模块开发与架构解析》3.Nginx模块开发入门 (教你用Nginx写"Hello World")4.Nginx源码剖析之内存池,与内存管理5.nginx源码... 阅读全文
posted @ 2015-07-21 16:27 Sawyer Ford 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1. 赛马问题: 一共有25匹马,有一个赛场,赛场有5个赛道,就是说最多同时可以有5匹马一起比赛。假设每匹马都跑的很稳定,不用任何其他工具,只通过马与马之间的比赛,试问,最少得比多少场才能知道跑得最快的5匹马?(不能使用撞大运的算法)解析:http://hxraid.iteye.com/blog/... 阅读全文
posted @ 2015-07-20 17:27 Sawyer Ford 阅读(6330) 评论(0) 推荐(0) 编辑
摘要: 全部内容来自《剑指offer》。题目一: 输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变。为简单起见,标点符号和普通字符一样处理。例如输入字符串“I am a student.”,则输出“student. a am I”。ANSWER:void reverse(char *pB... 阅读全文
posted @ 2015-07-18 19:04 Sawyer Ford 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 直接上代码了struct BTNode { int val; BTNode *lchild; BTNode *rchild; BTNode(int x): val(x), lchild(NULL), rchild(NULL){}};BTNode* rebuildBinTr... 阅读全文
posted @ 2015-07-15 20:36 Sawyer Ford 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 公式如下: 递归的解法我就不写了,贴一个递推的。long long Fibonacci(unsigned int n){ if (n <= 0) return 0; if (n == 1) return 1; long long a = 0; l... 阅读全文
posted @ 2015-07-14 19:34 Sawyer Ford 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum eleme... 阅读全文
posted @ 2015-07-13 19:47 Sawyer Ford 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1. 二分查找//递归版int binarySearch(const int arr[], int low, int high, int val){ if (low arr[mid]) return binarySearch(arr, mid+1, high, val)... 阅读全文
posted @ 2015-07-12 15:10 Sawyer Ford 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in th... 阅读全文
posted @ 2015-06-23 11:27 Sawyer Ford 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit ... 阅读全文
posted @ 2015-06-23 10:41 Sawyer Ford 阅读(178) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 22 下一页