上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 46 下一页

2014年11月18日

Java中equals和==的区别

摘要: 参考:http://www.cnblogs.com/zhxhdean/archive/2011/03/25/1995431.htmljava中的数据类型,可分为两类:1.基本数据类型,也称原始数据类型。byte,short,char,int,long,float,double,boolean 他们之... 阅读全文

posted @ 2014-11-18 12:08 luckygxf 阅读(326) 评论(0) 推荐(0) 编辑

2014年11月17日

Binary Tree Inorder Traversal

摘要: Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ... 阅读全文

posted @ 2014-11-17 22:20 luckygxf 阅读(126) 评论(0) 推荐(0) 编辑

Single Number

摘要: Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runti... 阅读全文

posted @ 2014-11-17 20:52 luckygxf 阅读(146) 评论(0) 推荐(0) 编辑

2014年11月16日

Valid Number

摘要: Valid NumberValidate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the ... 阅读全文

posted @ 2014-11-16 11:53 luckygxf 阅读(174) 评论(0) 推荐(0) 编辑

2014年11月15日

ZigZag Conversion

摘要: ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern i... 阅读全文

posted @ 2014-11-15 23:48 luckygxf 阅读(262) 评论(0) 推荐(0) 编辑

2014年11月14日

KMP

摘要: 1.KMP简介KMP是一个在字符串str中找一个子串pattern的匹配算法,在BF这种暴力匹配算法的基础上改进的。他是有三个人提出来的,所以用三个人的名字来命名这个算法2.KMP解释昨天和今天看了好几篇KMP的博客,有个人说的挺好的,坚持下去,就会有柳暗花明的感觉,下面是这位锅锅的博客地址,可以去... 阅读全文

posted @ 2014-11-14 23:29 luckygxf 阅读(186) 评论(0) 推荐(0) 编辑

2014年11月13日

01背包问题

摘要: 01背包问题用DP(动态规划实现)背包容量int c = 10物品个数int n = 5物品重量w[] = {0, 2, 2, 6, 5, 4}物品价值v[] = {0, 6, 3, 5, 4, 6}结果存放result[][] = new int[n + 1][c + 1]//result[i][... 阅读全文

posted @ 2014-11-13 19:49 luckygxf 阅读(165) 评论(0) 推荐(0) 编辑

Valid Sudoku

摘要: Valid SudokuDetermine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are ... 阅读全文

posted @ 2014-11-13 16:50 luckygxf 阅读(192) 评论(0) 推荐(0) 编辑

Implement strStr

摘要: Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.这里用的BF算法... 阅读全文

posted @ 2014-11-13 15:55 luckygxf 阅读(151) 评论(0) 推荐(0) 编辑

动态规划(DP)

摘要: 动态规划,Dynamic programming,不是Dynamic planning ...将问题分成若干子问题,前面的解为后面的解所用,注意逆向推倒,找出递推公式,经典的01背包问题,晚点实现一下,这里搞一个LeetCode上面的题放着记录一下神马求二项式系数,斐波拉契...都可以用动态规划来实... 阅读全文

posted @ 2014-11-13 15:24 luckygxf 阅读(186) 评论(0) 推荐(0) 编辑

上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 46 下一页

导航