leecode
文章平均质量分 73
JanFangZ
坚持,坚持就好了!
展开
-
hamming distance(汉明距离)
汉明距离题目: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. 两个整数之间的汉明距离是相应位不同的位置数。 Given two integers x and y, calculate the Hamming d原创 2017-10-07 21:00:33 · 1447 阅读 · 0 评论 -
【2017.11.28】编译可能产生的原因
Compile Error :编译错误!Compile Error可能产生的原因:变量未定义就使用,或定义后使用位置超出了定义的作用域 说明:如b=25但程序并未在使用前定义好b的类型,还应注意变量作用域。括号不匹配 说明:()、[]、{}一定要有始就得有终使用非法类型 说明:如__int64在GCC编译器下不识别,你却用它需少分号 说明:忘了语句以一个分号结束用函数未引头文件原创 2017-11-27 20:23:28 · 611 阅读 · 0 评论 -
决定开启自己Leecode的漫漫长路
漫漫长路,没错,是漫漫,md,本人的算法negligence实在是太渣渣了。为了增强自己的算法,每日总结,每日leecode至少三题(很少吧,很容易吧,加油吧少年!) 首先选择工具,用eplipse刷java,实在搞不懂的话就换成c版本的。原创 2017-11-27 15:41:04 · 187 阅读 · 0 评论 -
【2017.12.4】5.Longest Palindromic Substring最长回文子串
在之前的算法那本书有写过,这次重新写一篇 After all,we do not inherit the earth from ancestors.We borrow it form our children.5.1 Palindome 回文 回文是在两个方向读取相同的字符串的意思5.2 Dynamic Programming动态规划 动态规划(dynamic programming)原创 2017-12-04 21:24:28 · 267 阅读 · 0 评论 -
【2017.12.3】4.Median of Two Sorted Arrays(两个排序数组的中值)难
为了“减肥”这两个字,我感觉自己真的U付出了很多,但为了期待中的目标,渺茫而又希望渺小,我还会继续坚持下去。复杂度 Complexity时间复杂度 Time Complexity 按数量级递增排列,常见的时间复杂度有:常数阶O(1),对数阶O(log2n),线性阶O(n), 线性对数阶O(nlog2n),平方阶O(n2),立方阶O(n3),…, k次方阶O(nk),指数阶O(2n)。随着问题规模原创 2017-12-04 16:01:35 · 410 阅读 · 0 评论 -
【2017.12.10】10. Regular Expression Matching 正则表达式匹配
10.1 什么是正则表达式 Rugular Expression Matching 正则表达式,又称规则表达式。(英语:Regular Expression,在代码中常简写为regex、regexp或RE),计算机科学的一个概念。正则表通常被用来检索、替换那些符合某个模式(规则)的文本。给定一个正则表达式和另一个字符串,我们可以达到如下的目的: 1. 给定的字符串是否符合正则表达式的过滤逻辑原创 2017-12-11 19:35:08 · 331 阅读 · 0 评论 -
[2017.12.09]9. Palindrome Number 回文数字
Problem:Determine whether an integer is a palindrome. Do this without extra space.确定一个整数是否是回文。这样做没有额外的空寂那 Some hints:(提示)Could negative integers be palindromes? (ie, -1)If you are thinking of converti原创 2017-12-09 21:09:06 · 218 阅读 · 0 评论 -
【2017.12.9】8.String to Integer(atoi) 字符串到整数
8.1 Integer.MAX_VALUE 和 Integer.MIN_VALUE 整型数据的最大值和最小值 Integer.MAX_VALUE :2147483647 Integer.MAX_VALUE:-2147483648—————————————————分割线啦啦啦—————————————–8. String to Integer (atoi)Problem:Implement at原创 2017-12-09 18:55:16 · 163 阅读 · 0 评论 -
【2017.12.9】7.Reverse Integer 翻转整数
7.1 @param 注解单一属性在java里面,@param是参数的解释/***param s 这里表示对 s 的文字说明,描述*/public void aa(String s){}//一般 java 中 @表示注解,解释一个方法,类,属性的作用。实例一 @param注解单一属性 dao曾示例Public User selectUser(@param("userName") Strin原创 2017-12-09 11:43:43 · 172 阅读 · 0 评论 -
【2017.12.5】6.ZigZag Conversion(曲折转换)
6.1 ZigZag Conversion 打印时出现的字符图案 ZigZag的意识就是把字符串的顺序012345….按下图所示的排序6.2 String[] ans = new String[nRows];java 创建数组:使用new创建数组对象但是分配数组是会自动为数组分配默认值 6.2.1 一维数组的声明方式 type[] arrayName; //推荐 type a原创 2017-12-08 21:47:05 · 241 阅读 · 0 评论 -
【2017.11.30】3. Longest Substring Without Repeating Characters-最长字串不重复字符
3.1sub- 子substring()子字符串//javascript omen使用substring()从字符串提取一些字符<script type="text/javascript"> var str="Hello world!" document.write(str.substring(3,7)) //输出lo w</script>3.2 iterate 迭代原创 2017-11-29 21:33:42 · 228 阅读 · 0 评论 -
【2017.11.29】2.Add Two Numbers
non-非 non- 无,非,不 ag:The countries in the region signed a non-aggression pact。在该地区的国家签订了一个互不侵犯的条约non-empty :非空的non-negatice:非负的node:节点表示链表中的结点。pseudcode 伪代码 executable pseudcode 可执行的伪代码、伪代码是一种算原创 2017-11-28 20:29:30 · 247 阅读 · 0 评论 -
617.Merge Two Binary Trees(合并两棵树)
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. 给定两个二叉树,并想象当你把其中一个覆盖另一个时,两个树的一些节点是重叠的,而另一个没有。Y原创 2017-10-07 21:17:11 · 2651 阅读 · 0 评论 -
【2017.11.28】1. Two Sum
map是什么?//map是一个键值对,就像数组一样,比如说Map<Integer,Integer> map=new HashMap<Integer,String>();//创建一个map,因为map是一个接口,是所以只能创建map的子类map.put(123,"呵呵");Syetem.out.print(map.get(123));Map.containsKey/Map.containsValu原创 2017-11-27 21:15:37 · 167 阅读 · 0 评论