自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 问答 (1)
  • 收藏
  • 关注

原创 我来到上海

活着,就是为了见证魔法般的瞬间。 一个大三的学生,满怀着对未来的希望,急切的想要学到技术,再不断的学习和bat面试虐待下,终于有所进步,找到了个不错的实习,然而一个人的他走到了上海,度过了一夜之后,好像感受到了许多新的东西。 写这个并不是什么鸡汤,我也没有成功,是一个还没开始实习的学生,公司一般般,说出来会被人黑,是的——携程,而且我会Java,给我的前端岗位 我

2016-04-30 17:40:51 740 6

原创 Leetcode:Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character '.'. 翻译一下就是 给你个数独的二维数

2015-12-28 16:56:11 251

原创 LeetCode:Happy Number

Happy Number——LeetCode Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the

2015-12-27 14:14:59 320

原创 Leetcode:Product of Array Except Self

Product of Array Except Self *Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Solve it wi

2015-12-24 19:36:47 285

原创 Leetcode:Best Time to Buy and Sell Stock ⅠⅡⅢ

Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sel

2015-12-22 15:32:59 340

原创 Leetcode:bit manipulation

Bitwise AND of Numbers Range My Submissions QuestionGiven a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5

2015-12-20 18:48:24 381

原创 Leetcode:Subsets

Subsets Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets.For example,

2015-12-19 18:34:01 207

原创 Power of Two

很简单···判断一个整数是否是2的次方 自己写的办法就是傻傻的递归除以2 代码:public class Solution { public boolean isPowerOfTwo(int n) { if(n==1){ return true; } if(n==0){ return fals

2015-12-18 10:37:35 307

原创 Leetcode:Missing Number & Maximum Product of Word Lengths

Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.For example, Given nums = [0, 1, 3] return 2.这题很简单,不过有个坑爹的地方,就是给你[1,0]的时候,你也要返回2数组中都是

2015-12-17 16:09:51 286

原创 Single NumberⅡ

Single NumberⅡGiven an array of integers, every element appears three times except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it wi

2015-12-14 12:33:43 213

原创 leetcode:Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element

2015-12-13 16:09:37 282

原创 Single number Ⅲ

Single Number II Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.

2015-12-12 18:18:42 425

转载 关于空接口

今天看到一个很有意思的问题,如果我定义了一个接口,但是是空的,有什么作用呢? 苦思冥想了很久,作为一个个渣渣!我觉得竟然是个空接口!有和没有有个毛的区别啊!!!! 后来在论坛上看到了一个大牛,给了我想要的解答,醍醐灌顶一般! 下面是他的回答,使用了serializable这个接口做的例子,我不知道咋直接转过来额,就复制过来了 给你看个简单的例子,你就明白了

2015-12-11 21:03:13 5267

原创 leetcode:Invert Binary Tree

题目: 反转一个二叉树 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 选择采用递归的方法解决,由于本菜对于递归的理解实在是差,这里贴一下别人的代码/** * Definition for a binary tree no

2015-12-11 11:22:41 245

原创 Java类的基础问题

这几天在学习javaWeb,学到框架后看了点源码,发现自己java的基础实在薄弱!特此恶补了Java基础,今天看了些类的继承方面的内容,感受颇深!记录下来以免以后忘记 首先一个类中的成员变量或者方法被调用的时候就已经加载了这个类,但是如果此类有父类,那么便会先去加载父类 那么Z继承了X,在new Z()的时候究竟做了什么呢? 首先,我们明确 1.加载类的时候,会先扫一遍所有的stati

2015-12-10 20:52:02 645

原创 leetcode简单题:Same Tree

今天做了Same Tree这题,就是判断两个二叉树是否完全相等 由于开始没有考虑到 节点  为空的情况···报了个NullPointException空指针异常··· 后来加上了前面对于空节点的判断,终于如愿以偿获得了AC 有关二叉树求深度,判断是否相等,都用了递归的方法 为了更好的巩固!我特地找了些递归的好文章,放在这里,让自己更好的学习

2015-12-10 10:06:15 263

原创 leetcode每日一题

作为一个彩笔,想提高代码能力,前去leetcode修炼! 想记录下来每天的学习情况,发在空间里会被蠢的人说是卖弄,大神会来嘲讽 找个没人认识我的地方,记录下每题! 我是按照AC率从高到低做的 第一题 nim game :                                   简直就是小学奥数题,有木有!就看是不是4的倍数,直接return (n%4!=0)咯! 还

2015-12-09 13:43:33 561

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除