会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
thehappyyouth
上一页
1
2
3
4
5
下一页
2014年7月30日
leetcode-005 reorder list
摘要: 1 package leetcode; 2 3 public class ReOrderList { 4 public void reorderList(ListNode head) { 5 if(head==null||head.next==null||head.ne...
阅读全文
posted @ 2014-07-30 17:10 thehappyyouth
阅读(139)
评论(0)
推荐(0)
编辑
leetcode-004 insertion sort list
摘要: 1 package leetcode; 2 3 class ListNode { 4 int val; 5 ListNode next; 6 7 ListNode(int x) { 8 val = x; 9 next = null;10 ...
阅读全文
posted @ 2014-07-30 12:40 thehappyyouth
阅读(127)
评论(0)
推荐(0)
编辑
2014年7月29日
leetcode--003 LRU cache
摘要: 1 package leetcode; 2 3 import java.util.HashMap; 4 import java.util.Map; 5 6 class Node{ 7 int key; 8 int value; 9 Node pre;10 Nod...
阅读全文
posted @ 2014-07-29 17:23 thehappyyouth
阅读(159)
评论(0)
推荐(0)
编辑
leetcode--002 rpn
摘要: 1 package leetcode; 2 3 import java.util.Stack; 4 5 public class RPN { 6 public static int evalRPN(String[] tokens) { 7 Stack stack=n...
阅读全文
posted @ 2014-07-29 13:00 thehappyyouth
阅读(160)
评论(0)
推荐(0)
编辑
leetcode--001 max point on a line
摘要: 1 package leetcode; 2 3 import java.util.HashMap; 4 5 class Point{ 6 int x; 7 int y; 8 Point(){ 9 x=0;10 y=0;11 }12...
阅读全文
posted @ 2014-07-29 12:59 thehappyyouth
阅读(157)
评论(0)
推荐(0)
编辑
2014年5月8日
java实现——009Fibonacci数列
摘要: 1.循环 1 public class T009 { 2 public static void main(String[] args){ 3 System.out.println(fibonacci(3)); 4 } 5 public static long ...
阅读全文
posted @ 2014-05-08 15:53 thehappyyouth
阅读(165)
评论(0)
推荐(0)
编辑
java实现——008旋转数组的最小数字
摘要: 1 public class T008 { 2 public static void main(String[] args) { 3 int[] num = { 3, 4, 5, 1, 2 }; 4 System.out.println(min(num, 5...
阅读全文
posted @ 2014-05-08 15:19 thehappyyouth
阅读(195)
评论(0)
推荐(0)
编辑
java实现——007用两个栈实现队列
摘要: 1 import java.util.Stack; 2 3 public class T007 { 4 public static void main(String[] args) { 5 Queue q = new Queue(); 6 q.stack1...
阅读全文
posted @ 2014-05-08 11:17 thehappyyouth
阅读(168)
评论(0)
推荐(0)
编辑
java实现——030最小的k个数
摘要: 1.O(nlogk)海量数据 1 import java.util.TreeSet; 2 3 public class T030 { 4 public static void main(String[] args){ 5 int[] data = {4,5,1,6,2,7,...
阅读全文
posted @ 2014-05-08 10:23 thehappyyouth
阅读(247)
评论(0)
推荐(0)
编辑
java实现——006重建二叉树
摘要: 1 public class T006 { 2 public static void main(String[] args){ 3 int pre[] = {1,2,4,7,3,5,6,8}; 4 int in[] = {4,7,2,1,5,3,8,6}; ...
阅读全文
posted @ 2014-05-08 09:13 thehappyyouth
阅读(1045)
评论(0)
推荐(0)
编辑
上一页
1
2
3
4
5
下一页
公告
导航
博客园
首页
新随笔
新文章
联系
订阅
管理