-
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given[100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is[1, 2, 3, 4]. Return its length:4.
Your algorithm should run in O(n) complexity. ...
阅读题目
面试题
经典指数
-
-
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A =[1,1,1,2,2,3],
Your function should return length =5, and A is now[1,1,2,2,3]. ...
阅读题目
面试题
经典指数
-
下面程序执行结果为【说明:x86_64环境】()
int a[4][4] = {
{1, 2, 3, 4},
{50, 60, 70, 80},
{900, 1000, 1100, 1200},
{13000, 14000, 15000, 16000}
};
int( * p1)[4] = a;
int( * p2)[4] = & a[0];
int * p3 = & a[0][0];
printf("%d,%d,%d,%d\n",
* ( * (a + 1) - 1),
* ( * (p1 + 3) - 2) + 1,
* ( * (p2 - 1) + 16) + 2,
* (p3 + sizeof(p1) - 3)
); ...
阅读题目
面试题
经典指数
-
-
-
-
-
-
扫描后移动端查看
相关标签
同类标签
|
微信公众号
|
|
欢迎加入,一起群聊
|