The gray code is a binary numeral system where
two successive values differ in only one bit.Given a non-negative
integernrepresenting the total number...
分类:
其他好文 时间:
2014-06-04 18:58:39
阅读次数:
277
Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-04 18:55:07
阅读次数:
343
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-06-04 18:18:08
阅读次数:
259
Given a binary tree, determine if it is a valid
binary search tree (BST).Assume a BST is defined as follows:The left subtree of
a node contains only n...
分类:
其他好文 时间:
2014-06-03 14:00:56
阅读次数:
281
bfs+优先队列。wa了N次,才发现可以停留等待楼梯变换方向。 1 #include 2
#include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXNUM 55 8 9
typedef struct node...
分类:
其他好文 时间:
2014-06-03 13:26:06
阅读次数:
274
Off by One根据 Halvar Flake 在“Third Generation
Exploitation”中的描述,漏洞利用技术依攻击难度从小到大分为三类:1. 基础的栈溢出利用,可以利用返回地址轻松劫持进程,植入 shellcode,如对
strcpy、strcat 等函数的攻击。2. ...
分类:
编程语言 时间:
2014-05-30 22:16:39
阅读次数:
399
图的数组表示法借助一个二维数组表示图,该二维数组的第i行,第j列的值表示从Node[i]到Node[j]:无向图(网):是否有边 / 权值,arr[i][j]
== arr[j][i],无向图(网)的特性,矩阵关于对角线对称。有向图(网):是否有弧 / 权值。//图的数组表示法//最大顶点个数con...
分类:
其他好文 时间:
2014-05-30 21:56:24
阅读次数:
394
题目描述:输入一个链表,反转链表后,输出链表的所有元素。(hint :
请务必使用链表)输入:输入可能包含多个测试样例,输入以EOF结束。对于每个测试案例,输入的第一行为一个整数n(0next也就是p1来改变p1元素的位置,代码如下:Node
*p = head->next; Node *p1...
分类:
其他好文 时间:
2014-05-30 21:55:06
阅读次数:
349
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-05-30 16:30:00
阅读次数:
282
Follow up for problem "Populating Next Right
Pointers in Each Node".What if the given tree could be any binary tree? Would
your previous solution stil...
分类:
其他好文 时间:
2014-05-30 16:17:49
阅读次数:
210