Problem Description: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...
分类:
其他好文 时间:
2014-07-07 16:19:01
阅读次数:
188
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:
其他好文 时间:
2014-07-07 14:58:47
阅读次数:
175
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
分类:
其他好文 时间:
2014-07-07 14:48:39
阅读次数:
160
题目:Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the ...
分类:
其他好文 时间:
2014-07-07 14:06:19
阅读次数:
221
I Can Guess the Data Structure!Time limit: 1.000 secondsThere is a bag-like data structure, supporting two operations:1 xThrow an element x into the b...
分类:
其他好文 时间:
2014-07-07 13:26:22
阅读次数:
296
一.常用的寄存器
r0 -r3 临时变量 用于传递参数,传递返回指,当传递参数的参数大于4个时,用栈空间。即开辟sp
fp:frame pointer 记录回溯sp
ip: 很少用 ,临时存放sp
sp:指向栈顶
lr:link register 用于跳转时记录返回地址
pc:记录cpu运行指令的地址 因为arm采用流水线方式 取值 译码 执行等 pc=pc+8, 即pc指向当前执行的指令的下两条。
cpsr :状态寄存器,每种工作模式有自己的cpsr,记录当前...
分类:
其他好文 时间:
2014-06-30 07:53:36
阅读次数:
344
题目链接:点击打开链接
题意:给定一棵树
找2条点不重复的路径,使得两路径的长度乘积最大
思路:
1、为了保证点不重复,在图中删去一条边,枚举这条删边
2、这样得到了2个树,在各自的树中找最长链,即树的直径,然后相乘即可
#include
#include
#include
#include
#include
#include
#include
#include
#include
#i...
分类:
其他好文 时间:
2014-06-30 07:30:01
阅读次数:
235
题目
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time
complexity should be O(log (m+n)).
方法
转换为寻找第k大的数。
...
分类:
其他好文 时间:
2014-06-30 06:05:58
阅读次数:
261
题目
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operations permitte...
分类:
其他好文 时间:
2014-06-30 00:46:38
阅读次数:
262
题目
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.
Given an integer n, return all distinct solutions to the n-que...
分类:
其他好文 时间:
2014-06-30 00:34:18
阅读次数:
188