- 博客(12)
- 资源 (5)
- 收藏
- 关注
原创 【leetcode】58. Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is
2016-06-30 11:08:58 432
转载 【leetcode】24. Swap Nodes in Pairs
http://www.2cto.com/kf/201310/251331.htmlGiven a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.You
2016-06-30 10:42:02 283
原创 【leetcode】2. Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
2016-06-28 11:24:53 434
原创 【leetcode】21. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.将两个排好序的链表合并成一个链表。一次5分钟写好的代码就ac了,正好刚下班,很开心 //21. Mer
2016-06-27 21:35:59 220
原创 【leetcode】26. Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2016-06-27 21:08:51 264
原创 【leetcode】9. Palindrome Number
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 converting the integer to string
2016-06-27 10:35:42 216
原创 【leetcode】7. Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321特殊情况:超过了Int最大范围返回0,小于int最小值返回0 public int reverse(int x) { final int MAX = 0x7fffffff;
2016-06-24 19:52:41 337
原创 java中的lambda表达式
java 8 的 lambda表达式参考: http://www.infoq.com/cn/articles/Java-se-8-lambda http://ifeve.com/lambda/举个栗子/** * 测试lambda表达式 * @author menglei */public class lambda { public static void runThreadUseL
2016-06-17 19:46:26 1067
原创 游戏设计中排行榜的设计和位运算的巧用
本文为作者原创,如需转载请标注出处。 http://blog.csdn.net/eclipse_c在游戏中有各种各样的排行榜需求,比如按照战斗力来进行排行,如果战力相同,那么就比较玩家等级,等等。下面介绍一种排行榜的设计,排名依据有多个字段,如:等级>战力>声望简单说下需求:宗门分为正派邪派,女宗。其中女宗也分正邪,只是多出来的一个字段来标识女性角色。正
2016-06-12 17:58:29 1987
转载 [java] abstract class 和interface 的区别
http://www.cnblogs.com/bluestorm/archive/2012/03/02/2377326.html---------------------------------------------------抽象类定义规则(1)抽象类和抽象方法都必须用abstract关键字来修饰。(2)抽象类不能被实例化,也就是不能用new关键字去产生对象。(3)抽象
2016-06-02 11:45:56 305
转载 Java多线程面试问题
转自: http://blog.jobbole.com/76308/ 多线程和并发问题是Java技术面试中面试官比较喜欢问的问题之一。在这里,从面试的角度列出了大部分重要的问题,但是你仍然应该牢固的掌握Java多线程基础知识来对应日后碰到的问题。(校对注:非常赞同这个观点)Java多线程面试问题1. 进程和线程之间有什么不同?一个进程是一个独立(self c
2016-06-01 20:54:38 351
原创 最近积累的一些问题
question.mdjava如何控制启动一个线程? http://blog.csdn.net/typename/article/details/7212512java中callback的理解。 http://blog.csdn.net/imzoer/article/details/9422013 创建匿名内部类,继承接口,接口中封装callback函数。 匿名内部类也就是没有名字的内部
2016-06-01 20:22:53 294
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人