Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2014-06-18 21:56:47
阅读次数:
209
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 ...
分类:
其他好文 时间:
2014-06-18 17:39:11
阅读次数:
260
Nightmare
时间限制:1000 ms | 内存限制:65535 KB
难度:4
描述
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should ...
分类:
Web程序 时间:
2014-06-16 18:57:52
阅读次数:
268
原题地址:https://oj.leetcode.com/problems/merge-two-sorted-lists/题意:Merge two sorted linked lists and return it as a new list. The new list should be made...
分类:
编程语言 时间:
2014-06-15 21:58:31
阅读次数:
238
1、
??
Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 uni...
分类:
其他好文 时间:
2014-06-15 09:09:00
阅读次数:
256
Description:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->...
分类:
其他好文 时间:
2014-06-15 07:35:31
阅读次数:
151
LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get...
分类:
其他好文 时间:
2014-06-14 23:54:37
阅读次数:
352
Description:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preser...
分类:
其他好文 时间:
2014-06-14 19:11:15
阅读次数:
173
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...
分类:
其他好文 时间:
2014-06-14 16:08:32
阅读次数:
200
Swap Nodes in Pairs:Given a linked list, swap every
two adjacent nodes and return its head.For example,Given1->2->3->4, you
should return the list as2...
分类:
其他好文 时间:
2014-06-13 17:04:27
阅读次数:
180