码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
Remove Duplicates from Sorted Array
题目链接https://leetcode.com/problems/remove-duplicates-from-sorted-array/思路就是维护两个pointer,一个,i, 用于遍历整个数组,另一个,len, 用于保存当前的无重复元素的数组的最后一个positionif A[i] == A...
分类:其他好文   时间:2015-04-16 06:42:09    阅读次数:118
Rotate Array
题目链接https://leetcode.com/problems/rotate-array/这道题主要是想明白rotate是怎样完成的,举个例子{1,2,3,4,5,6,7}, k=3我们发现完成rotate 3需要进行一下三步1)reverse array {1,2,3,4,5,6,7} => ...
分类:其他好文   时间:2015-04-16 06:40:23    阅读次数:125
7. Reverse Integer
题目:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321链接:http://leetcode.com/problems/reverse-integer/题解:
分类:其他好文   时间:2015-04-15 23:08:46    阅读次数:121
spoj LCS 后缀自动机
链接:http://www.spoj.com/problems/LCS/题意两串LCS确实没什么好说的,第一次编嘛。把网上的教程斗翻出来看一遍就好了。另发现,百度内部用户交流使用的图片在百度快照中看得到。#include#include#include#includeusing namespace ...
分类:其他好文   时间:2015-04-15 21:06:36    阅读次数:211
机器学习实战——朴素贝叶斯
from numpy import * # 创建一个实验样本 def loadDataSet(): postingList = [['my','dog','has','flea','problems','help','please'], ['maybe','not','take','him','to','dog','park','stupid'...
分类:其他好文   时间:2015-04-15 19:38:37    阅读次数:160
Min Stack
https://leetcode.com/problems/min-stack/Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Pu...
分类:其他好文   时间:2015-04-15 16:44:16    阅读次数:126
android-studio 使用过程遇到的问题,持续中...
1、Rendering Problems Missing styles 设计界面布局时显示的错误: [plain] view plaincopy Rendering Problems    Missing styles. Is the correct theme chosen for this layout?     Use the Them...
分类:移动开发   时间:2015-04-15 13:43:23    阅读次数:190
Leetcode Permutations
题目地址:https://leetcode.com/problems/permutations/题目分析:很明显可以使用递归,先将起始位置与后面的每个数字交换位置,然后将起始位置往后移以为,以该起始位置为起点求排列,依次类推即可使用递归法。题目解答:import java.util.ArrayLis...
分类:其他好文   时间:2015-04-15 13:24:58    阅读次数:103
POJ 1207 The 3n + 1 problem (数学)
The 3n + 1 problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 53448   Accepted: 16999 Description Problems in Computer Science are often classified as b...
分类:其他好文   时间:2015-04-15 09:48:00    阅读次数:149
Leetcode Sudoku Solver
题目地址:https://leetcode.com/problems/sudoku-solver/题目解析:使用最笨的办法,行优先遍历需要填的空,使用1到9去尝试,然后判断是否符合条件;如果不符合条件则尝试下一个数字,如果符合条件则尝试下一个需要填的空。使用递归方法实现。题目解答:public cl...
分类:其他好文   时间:2015-04-14 15:58:54    阅读次数:179
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!