最大堆能够在O(1)的时间内取得集合中的最大值,并且在集合中加入新元素的时候,能够以O(Logn)的时间将新的元素插入到堆中。当取出最大的元素时,能够以O(Logn)的时间重新将堆整理成最大堆。最小堆同理。最大优先级队列的应用实例:基于优先级的作业调度,在所有等待调度的作业中,选择具有最大优先级作业...
分类:
其他好文 时间:
2014-05-01 09:21:41
阅读次数:
386
原题地址:http://oj.leetcode.com/problems/linked-list-cycle-ii/题意:如果链表中存在环路,找到环路的起点节点。解题思路:这道题有点意思。首先使用快慢指针技巧,如果fast指针和slow指针相遇,则说明链表存在环路。具体技巧参见上一篇http://w...
分类:
编程语言 时间:
2014-05-01 08:19:31
阅读次数:
340
Java 115 Java Interview Questions and Answers –
The ULTIMATE List 3 Good Reasons to Avoid Arrays in Java Interfaces Other Top 10
Algorithms for Coding...
分类:
其他好文 时间:
2014-05-01 08:02:00
阅读次数:
318
1. ie的文档流样式 writing-mode:tb-rl.box1 a{
writing-mode:tb-rl; /* 触发layout 后面高度生效,文档流 自上往下,自右往左,宽度要自适应,文字方向在垂直方向居中 */
height:100%; vertical-align:middle}2...
分类:
Web程序 时间:
2014-05-01 07:59:22
阅读次数:
496
引言
工具条作为大多数标准的Windows应用程序的一个重要组成部分,使其成为促进人机界面友好的一个重要工具。通过工具条极大方便了用户对程序的操作,但是在由Microsoft
Visual C++开发环境所创建的应用程序框架中的工具条只是一个简单的按钮的集合,在功能上也仅仅是起到了菜单快捷方式的作....
分类:
其他好文 时间:
2014-05-01 06:56:43
阅读次数:
420
原题地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/题意:将链表中的节点两两交换。Given1->2->3->4,
you should return the list as2->1->4->3.解题思路:这题主要涉及到链表的操作,没什么...
分类:
编程语言 时间:
2014-05-01 06:44:21
阅读次数:
339
原题地址:http://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/题意:Given
a linked list, remove thenthnode from the end of list and return its he...
分类:
编程语言 时间:
2014-05-01 06:42:15
阅读次数:
332
题目链接Given a list, rotate the list to the right
bykplaces, wherekis non-negative.For
example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.首...
分类:
其他好文 时间:
2014-05-01 04:52:19
阅读次数:
288
泛型作用于编译阶段:
泛型是作用于编译阶段,在编译阶段控制类型,以确保在编写代码的时候只能传入指定类型数据到泛型集合对象中去。如何验证呢,贴代码如下:
package highBasic.generic;import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import ja...
分类:
编程语言 时间:
2014-04-29 13:34:22
阅读次数:
277