- 博客(9)
- 资源 (1)
- 收藏
- 关注
转载 LintCode Copy Books
转自:Copy BooksGiven an array A of integer with size of n( means n books and number of pages of each book) and k people to copy the book. You must distribute the continuous id bo
2015-08-25 17:40:21 1182
转载 java数组合并
转自:http://www.cnblogs.com/changhongzhi/articles/2242323.html三种字符数组合并的方法public static String[] getOneArray() { String[] a = { "0", "1", "2" }; String[] b = { "0", "1", "2" }; String[]
2015-08-24 19:19:12 464
原创 LintCode 翻转二叉树
样例 1 1 / \ / \2 3 => 3 2 / \ 4 4挑战递归固然可行,能否写个非递归的?public void invertBinaryTree(TreeNode root) { // write your code here if (root
2015-08-20 16:08:02 274
原创 LintCode 寻找缺失的数
题目: 寻找缺失的数给出一个包含 0 .. N 中 N 个数的序列,找出0 .. N 中没有出现在序列中的那个数。样例N = 4 且序列为 [0, 1, 3] 时,缺失的数为2。注意可以改变序列中数的位置。挑战在数组上原地完成,使用O(1)的额外空间和O(N)的时间。代码如下: public int fin
2015-08-20 15:46:48 318
原创 java集合知识点概括
一.类图二.总结1.collection是集合的总接口,list,set,queue继承collection.2.list是元素有序的,使用了索引,允许为空,允许重复.继承它的实现类有Vector(同步数组),Arraylist(不同步数组),linkedlist(链表),stack继承vector,加上5个额外的方法得以当做堆栈使用(push,pop,
2015-07-21 16:28:52 514
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人