- 博客(6)
- 资源 (4)
- 问答 (2)
- 收藏
- 关注
原创 Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 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)).解题思路: 先求出两个数组元素个数之和numsSize,则
2015-08-27 20:22:27 310
原创 Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of the
2015-08-25 11:57:11 275
原创 Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note: Do not modify the linked list.Follow up: Can you solve it without using extra space?解题思路: (1)用快慢指针
2015-08-25 10:41:47 279
原创 360在线笔试题:挑选镇长
题目的描述如下所示: 输入输出要求如下: #include #include struct GX { int num1;//renshi ta de ren; int num2;//ta renshi de ren; }; int main(void) { int T; int n,m; int** guanxi; int i
2015-08-11 22:20:10 1291
原创 Reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes’ values.For example, Given {1,2,3,4}, reorder it to {1,4,2,3}
2015-08-09 13:42:42 300
原创 Majority Element II
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.解题思路: (1)定义两个大小为2数组,一个为temp[2]存储元素,一个为times[2]存储次数 (
2015-08-05 16:58:16 323
Convert To Renex
2013-11-14
注释掉printf语句程序出现段错误
2015-12-25
攻击者能够欺骗 DNS,如何解决?
2014-12-12
TA创建的收藏夹 TA关注的收藏夹
TA关注的人