![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程
文章平均质量分 56
brucecp827
这个作者很懒,什么都没留下…
展开
-
JAVA 常用数据结构操作
1. Queueoffer(E);poll();peek();isEmpty();2.Deque (代替stack)offerLast(E) / offerFirst(E)pollLast() / pollFirst()peekLast() / peekFirst()isEmpty()原创 2015-06-21 02:42:09 · 193 阅读 · 0 评论 -
Permutation 各种变种
import java.util.ArrayList;import java.util.HashSet;import java.util.List;import java.util.Set;Find all possible combinations of k numbers that add up to a number n, given that only number原创 2015-06-21 01:39:54 · 216 阅读 · 0 评论 -
complete binary tree
1.原创 2015-06-14 04:37:45 · 217 阅读 · 0 评论 -
Complete Tree 的一些知识点
1.如果一个complete tree 所有的Node都有2个子Node,那么它就是一个full-tree,那么如果depth是n,所有node的个数就是2 ^0 + 2^1 + 2^2 + ....+2^n =2^(n + 1) - 12.depth 的定义,当只有root node的时候,depth = 0, 也就是说3个Node的full-tree的depth是1.原创 2015-06-14 04:31:49 · 472 阅读 · 0 评论 -
常用的技巧和知识点整合
1.在Array中取到一对一对的数,如1,2,3,4,5变成(1,2) (3,4) (5):方法:int i = 0;for (; i int num1 = arr[i * 2];int num2 = arr[i*2 + 1];}if (i * 2 int last = arr[i * 2];//个数为奇数的时候取得最后一位数字}原创 2015-06-10 12:21:59 · 373 阅读 · 0 评论 -
String 有关概念
转载自:http://cymoft.blog.51cto.com/324099/473220/Java面试中总喜欢出几个关于String对象的题,比如:1.String s = new String("abc");创建了几个String对象。2.String s1 = "abc"; String s2 = "a"; String s3 = s2 + "bc"转载 2015-07-01 12:47:31 · 217 阅读 · 0 评论