Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s...
分类:
其他好文 时间:
2014-10-07 12:03:03
阅读次数:
231
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight forward. Could you devis...
分类:
其他好文 时间:
2014-10-06 18:43:20
阅读次数:
201
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-10-06 13:11:00
阅读次数:
167
包含向上、向下两种维护方向,方便手动维护堆中单个元素(STL的priority_queue和make_heap没有这种功能T_T)namespaceheap{#definep(x)((x)>>1)#definel(x)((x)structheap{Theap[maxn];intsize;bool(....
分类:
其他好文 时间:
2014-10-06 12:01:20
阅读次数:
123
术语 1、 virtual address space 虚拟地址空间 它是一个应用程序可以访问的最大地址空间、32位机上是4G(2^32)、虚拟地址空间中的数据不一定在物理内存里。可能在缓存文件中。术语 2、 physical memory 物理内存 内存心片提供的存储空间。...
分类:
数据库 时间:
2014-10-06 02:46:09
阅读次数:
236
优先级队列相对于普通队列,提供了插队功能,每次最先出队的不是最先入队的元素,而是优先级最高的元素。它的实现采用了标准库提供的heap算法。该系列算法一共提供了四个函数。使用方式如下:首先建立一个容器,放入元素:1 vector vec;2 insertNums(vec, 3, 7);3 insert...
分类:
其他好文 时间:
2014-10-05 22:44:29
阅读次数:
229
sublime text 是一款非常优秀的代码编辑器,界面简洁优美,功能强大,使用十分便捷,如果喜欢这款代码编辑器朋友可以到官网下载安装。sublime text 默认的制表符是TAB,但是为了保证代码在各种环境下的规范性,开发人员会将TAB改为空格(space),缩进一次为两个空格。在sublim...
分类:
其他好文 时间:
2014-10-05 17:41:48
阅读次数:
634
优先级队列相对于普通队列,提供了插队功能,每次最先出队的不是最先入队的元素,而是优先级最高的元素。 它的实现采用了标准库提供的heap算法。该系列算法一共提供了四个函数。使用方式如下: 首先,建立一个容器,放入元素: vector coll;
insertNums(coll, 3, 7);
inse...
分类:
其他好文 时间:
2014-10-05 17:31:28
阅读次数:
341
1、找到这个配置文件2、修改配置文件说明:PermSize和MaxPermSize指明虚拟机为java永久生成对象(Permanate generation)等这些可反射(reflective)对象分配内存限制,这些内存不包括在Heap(堆内存)区之中。-Xms128m 表示JVM Heap(堆内存...
分类:
编程语言 时间:
2014-10-05 12:13:38
阅读次数:
242
Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl...
分类:
其他好文 时间:
2014-10-05 01:54:47
阅读次数:
345