上一页 1 2 3 4 5 6 7 ··· 22 下一页
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1v2) return 1; if(v1<v2) return -1; ... 阅读全文
posted @ 2015-06-16 05:29 世界到处都是小星星 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
posted @ 2015-06-16 05:13 世界到处都是小星星 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Given two strings S and T, determine if they are both one edit distance apart.Hint:1. If | n – m | is greater than 1, we know immediately both are not... 阅读全文
posted @ 2015-06-16 04:16 世界到处都是小星星 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 网上抄的http://blog.csdn.net/whuwangyi/article/details/43186045Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left ... 阅读全文
posted @ 2015-06-16 03:27 世界到处都是小星星 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-06-16 03:03 世界到处都是小星星 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 话说我们昨晚去看了侏罗纪公园,原来xd就是我最爱的巨幕,来美国这么多年了,怀念和小星星一路成长,一路看电影的经历,avatar是我们在美国一起看的第一部电影。老美看完好片子,还喜欢鼓个掌。这题one pass in place就是麻烦,要多做个string来判断单词要用到sb的insert,不过可以... 阅读全文
posted @ 2015-06-16 01:06 世界到处都是小星星 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 很简单的stack,注意operation orderpublic class Solution { public int evalRPN(String[] tokens) { if(tokens ==null|| tokens.length==0) return 0; ... 阅读全文
posted @ 2015-06-15 04:39 世界到处都是小星星 阅读(133) 评论(0) 推荐(0) 编辑
摘要: http://bookshadow.com/weblog/2015/01/19/leetcode-binary-tree-postorder-traversal/http://bookshadow.com/weblog/2015/01/19/binary-tree-post-order-traver... 阅读全文
posted @ 2015-06-13 11:44 世界到处都是小星星 阅读(102) 评论(0) 推荐(0) 编辑
摘要: ref linkhttp://blog.sina.com.cn/s/blog_eb52001d0102v1si.html摘抄感谢以下文章的作者:BIN大神的大总结:http://blog.csdn.net/fightforyourdream/article/details/16843303 面试... 阅读全文
posted @ 2015-06-13 10:11 世界到处都是小星星 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 树的遍历当初觉得难死,现在还好public class Solution { public ArrayList preorderTraversal(TreeNode root) { ArrayList res = new ArrayList(); if(root=... 阅读全文
posted @ 2015-06-13 07:00 世界到处都是小星星 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 22 下一页