码迷,mamicode.com
首页 >  
搜索关键字:medium    ( 2358个结果
一不注意就看到了这么好的东西,mark
27 iOS open source libraries to skyrocket your development.You don’t want to miss them. Really.下面献上原文地址链接:https://medium.com/ios-os-x-development/27-i...
分类:其他好文   时间:2015-06-17 14:42:10    阅读次数:127
46 Permutations(全排列Medium)
题目意思:全排列思路:其实看这题目意思,是不太希望用递归的,不过还是用了递归,非递归的以后再搞吧 ps:vector这玩意不能随便返回,开始递归方法用vector,直接到500ms,换成void,到12ms 1 class Solution { 2 public: 3 vector> pe...
分类:其他好文   时间:2015-06-14 22:35:33    阅读次数:185
141 Linked List Cycle(判断链表是否有环Medium)
题目意思:链表有环,返回true,否则返回false思路:两个指针,一快一慢,能相遇则有环,为空了没环 ps:很多链表的题目:都可以采用这种思路 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * ...
分类:其他好文   时间:2015-06-14 16:30:04    阅读次数:133
35 Search Insert Position(找到数的位置Medium)
题目意思:在递增数组中找到目标数的位置,如果目标数不在数组中,返回其应该在的位置。思路:折半查找,和相邻数比较,注意边界 1 class Solution { 2 public: 3 int searchInsert(vector& nums, int target) { 4 ...
分类:其他好文   时间:2015-06-14 12:22:42    阅读次数:98
94 Binary Tree Inorder Traversal(二叉树中序遍历Medium)
题目意思:二叉树中序遍历,结果存在vector中解题思路:迭代迭代实现: 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6...
分类:其他好文   时间:2015-06-14 09:22:11    阅读次数:128
144 Binary Tree Preorder Traversal(二叉树先序遍历Medium)
题目意思:二叉树先序遍历,结果存在vector中解题思路:1.递归(题目中说用递归做没什么意义,我也就贴贴代码吧) 2.迭代迭代实现: 1 class Solution { 2 public: 3 vector preorderTraversal(TreeNode* root) { ...
分类:其他好文   时间:2015-06-13 15:36:18    阅读次数:110
50 Pow(x, n)(求x的n次方Medium)
题目意思:x为double,n为int,求x的n次方思路分析:直接求,注意临界条件 1 class Solution { 2 public: 3 double myPow(double x, int n) { 4 if(x==1.0)return x; 5 e...
分类:其他好文   时间:2015-06-13 06:16:35    阅读次数:121
136 Single Number(找唯一数Medium)
题目意思:一个int数组,有一个数只出现一次,其他数均出现两次,找到这个唯一数知识普及:~:非运算,单目运算符1为0,0为1; &:与运算,都为1则为1,否则为0 |:或运算,全为0则为0,否则为1 ^:异或运算,相同为0,不同为1思路:将数组中元素进行异或运算,则只剩下0...
分类:其他好文   时间:2015-06-12 11:31:24    阅读次数:102
我常常浏览的博客和网站
我常常浏览的博客和网站http://www.jianshu.com/p/e5353a1a752c?utm_campaign=maleskine&utm_content=note&utm_medium=pc_author_hots&utm_source=recommendation英文系列网站Rayw...
分类:Web程序   时间:2015-06-11 16:22:09    阅读次数:107
[LeetCode] Remove Duplicates from Sorted Array
Well, a medium problem. Use two pointers. One points to the curren number and the other points to the last unique number. Once duplicates occur, move ...
分类:其他好文   时间:2015-06-09 23:22:45    阅读次数:122
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!