描述
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in ...
分类:
其他好文 时间:
2014-07-14 13:46:43
阅读次数:
229
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 to m + n) to hold additional elements from ...
分类:
其他好文 时间:
2014-07-13 17:21:40
阅读次数:
208
这里记录下堆的相关操作。
op 1:
'''
@ data: the heap array
@ p : index of parent item
@ n : number of data
@@ Swap p and it's son items, make p the largest of them
'''
def swapForMaxHeap(data, n, p):
l...
分类:
其他好文 时间:
2014-07-13 17:07:15
阅读次数:
223
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
/**
* Definition for singly-linked list.
* class ListNode {
* int val;
* ...
分类:
其他好文 时间:
2014-07-13 16:32:04
阅读次数:
152
多重背包问题。
我的背包训练第三题,多重背包。似乎有点理解多重背包了。
我对背包九讲多重背包的理解:
当某件物品 体积*数量 超过背包的容积的时候,这就做完全背包(相当于无限取)
void completepack(int h,int cost,int a)
{
for(int i=cost;i<=a;i++)
dp[i]=max(d...
分类:
其他好文 时间:
2014-07-13 00:09:57
阅读次数:
192
Exception in thread "HSQLDB Connection @429be9" java.lang.OutOfMemoryError: Java heap space
在服务器下的data/xxxx也就是数据库路径下,我的在F:\tomcat7\bin\data下删掉关于xxxx的文件及文件夹。...
分类:
数据库 时间:
2014-07-12 22:08:20
阅读次数:
338
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. Y...
分类:
其他好文 时间:
2014-07-12 20:39:17
阅读次数:
225
先看代码,有标注,很详细,看看是如何设定x、y轴的可视范围、移动范围、已经如何确定原点的位置的、还有就是如何固定坐标轴!!!
//坐标轴的初始化
-(void)axesInit
{
// Setup plot space: 设置一屏内可显示的x,y量度范围
CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)[xyGraph default...
分类:
其他好文 时间:
2014-07-12 20:03:37
阅读次数:
349
Description
Read the statement of problem G for the definitions concerning trees. In the following we define the basic terminology of heaps. A heap is a tree whose internal nodes have each assigned...
分类:
其他好文 时间:
2014-07-12 18:52:12
阅读次数:
285
1、问题:原来将源码放在根目录下面
编译过程中出现了 no space left on device
利用df -h 命令查看 根目录空间占用完毕
2、将源码改在其他空间很足的地方编译
在make module_install 还是出现no space left on device
但是该目录下面的空间很足
,继续df -h
根目录满了
3解决方法
将根目录中的不用的文...
分类:
其他好文 时间:
2014-07-12 17:19:42
阅读次数:
205