题目:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only cons...
分类:
其他好文 时间:
2014-08-29 13:13:37
阅读次数:
169
Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp...
分类:
其他好文 时间:
2014-08-29 01:18:36
阅读次数:
275
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.public cl...
分类:
其他好文 时间:
2014-08-29 01:16:36
阅读次数:
267
Bean bags for many years. Although it is an old design, people feel like it, and still one of the most sought after tools today. If you are looking fo...
分类:
其他好文 时间:
2014-08-28 13:01:39
阅读次数:
263
They are a very critical element of various warehouses and distribution centers. Bahamas. The fantastic modification should boost ideal properties eve...
分类:
其他好文 时间:
2014-08-28 09:37:59
阅读次数:
239
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:
其他好文 时间:
2014-08-27 21:50:28
阅读次数:
210
1 Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear run...
分类:
其他好文 时间:
2014-08-27 18:38:28
阅读次数:
174
[ 问题: ]
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one....
分类:
其他好文 时间:
2014-08-27 16:43:58
阅读次数:
177
Median of Two Sorted Arrays
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 (...
分类:
其他好文 时间:
2014-08-27 14:47:18
阅读次数:
148
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following...
分类:
其他好文 时间:
2014-08-26 19:19:56
阅读次数:
165