题目链接https://leetcode.com/problems/remove-duplicates-from-sorted-array/思路就是维护两个pointer,一个,i, 用于遍历整个数组,另一个,len, 用于保存当前的无重复元素的数组的最后一个positionif A[i] == A...
分类:
其他好文 时间:
2015-04-16 06:42:09
阅读次数:
118
题目挺长的,其实只需要关注第一行就OK了。这道题思路挺明显的,对于图来说要么BFS,要么DFS,至于具体细节,我觉得与138题:Copy List with Random Pointer很像。在BFS或DFS过程中,可能要调整顶点的邻接点,这个时候不要忘了它的邻接点可能还没有创建。所以,有以下思路:...
分类:
其他好文 时间:
2015-04-16 01:18:18
阅读次数:
244
ESP是栈顶指针 Extended Stack Pointer
EBP是基址指针 Extend Base Pointer
ESP就是一直指向栈顶的指针,而EBP只是用于存取某时刻的栈顶指针,以方便对栈的操作
使用__stdcall的话,调用侧从右往左压栈函数参数,但不退栈,需要函数退栈
使用__cdecl的话,调用侧从右往左压栈函数参数,并且在调用后,调用侧主动执行退栈...
分类:
其他好文 时间:
2015-04-15 09:37:30
阅读次数:
153
Codeforces VK Cup 2015 Wild Card Round 1 (AB)...
分类:
其他好文 时间:
2015-04-14 23:19:51
阅读次数:
278
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
这是一道链表操作的题目,要求复制一个链表,不过链表的每个结点...
分类:
其他好文 时间:
2015-04-14 16:50:18
阅读次数:
133
1 #pingfen li{2 width:27px;3 float:left;4 height:28px;5 cursor:pointer;6 background:url('star.gif') no-re...
分类:
Web程序 时间:
2015-04-14 16:13:58
阅读次数:
123
一、引用简介 引用就是指针,可以指向变量、数组、哈希表甚至是子程序。二、使用引用 如果$pointer的值为一个数组的指针,则通过形式@$pointer来访问数组中的元素。形式@$pointer的意义为“取出$pointer中的地址值当作数组使用”。类似的,%$pointer为指向哈希表中第一个.....
分类:
其他好文 时间:
2015-04-13 16:21:27
阅读次数:
112
//用指针函数完成:有a个学生,每个学生有b门课。要求在输入学生序号后输出该学生成绩
#include
float * search(float (* pointer )[4],int n) //形参pointer是一个数组指针
{
float *pt;
pt=*(pointer+n);
return pt;
}
int main()
{
float score[][4]={{60,...
分类:
编程语言 时间:
2015-04-12 00:06:05
阅读次数:
265
题目:
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right n...
分类:
其他好文 时间:
2015-04-11 00:07:02
阅读次数:
170
Android Touch事件分发详解先说一些基本的知识,方便后面分析源码时能更好理解。
- 所有Touch事件都被封装成MotionEvent对象,包括Touch的位置、历史记录、第几个手指等.
事件类型分为ACTION_DOWN,ACTION_UP,ACTION_MOVE,ACTION_POINTER_DOWN,ACTION_POINTER_UP,ACTION_CANCEL, 每个
一个完整...
分类:
移动开发 时间:
2015-04-10 15:35:11
阅读次数:
170