![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
风顺水流
never stop!
展开
-
LeetCode-001-TwoSum
class Solution { public: vector twoSum(vector& nums, int target) { int i; int j; vector tmp; for ( i = 0; i for ( j = nums.size()-1; j>i; j-- ){原创 2015-11-17 01:05:36 · 335 阅读 · 0 评论 -
LintCode-剑指Offer-(159)寻找旋转排序数组中的最小值
class Solution { public: /** * @param num: a rotated sorted array * @return: the minimum number in the array */ //这个没有技巧,直接遍历 int findMin(vector &num) { // write原创 2015-11-17 00:01:52 · 269 阅读 · 0 评论 -
LintCode-剑指Offer-(204)单例
class Solution { public: /** * @return: The same instance of this class every time */ static Solution* getInstance() { // write your code here static bool ex=f原创 2015-11-16 23:46:50 · 1436 阅读 · 0 评论 -
LintCode-剑指Offer-(365)二进制中有多少个1
class Solution { public: /** * @param num: an integer * @return: an integer, the number of ones in num */ int countOnes(int num) { // write your code here原创 2015-11-16 23:45:16 · 817 阅读 · 0 评论 -
LintCode-剑指Offer-空格替换
class Solution { public: /** * @param string: An array of Char * @param length: The true length of the string * @return: The true length of new string */ int replace原创 2015-11-16 23:43:39 · 324 阅读 · 0 评论 -
LintCode-剑指Offer-斐波拉契
class Solution{ public: /** * @param n: an integer * @return an integer f(n) */ int fibonacci(int n) { // write your code here int tmp[3]={0,1,原创 2015-11-16 23:42:05 · 363 阅读 · 0 评论 -
LintCode-剑指Offer-翻转链表
/** * Definition of ListNode * * class ListNode { * public: * int val; * ListNode *next; * * ListNode(int val) { * this->val = val; * this->next = NUL原创 2015-11-16 23:40:04 · 357 阅读 · 0 评论