题目描述Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if t...
分类:
系统相关 时间:
2015-04-26 12:26:48
阅读次数:
133
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using...
分类:
其他好文 时间:
2015-04-26 09:14:50
阅读次数:
108
问题描述对于一个给定的数组,找出2个数,它们满足2个数的和等于一个特定的数,返回这两个数的索引。(从1开始)
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t...
分类:
其他好文 时间:
2015-04-24 12:38:32
阅读次数:
132
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->3.Your algor...
分类:
其他好文 时间:
2015-04-24 12:00:35
阅读次数:
98
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....
分类:
其他好文 时间:
2015-04-23 21:50:22
阅读次数:
141
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ta...
分类:
其他好文 时间:
2015-04-23 21:49:00
阅读次数:
153
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
编程语言 时间:
2015-04-23 21:19:09
阅读次数:
138
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 unique BST's shown below.
1 3 ...
分类:
其他好文 时间:
2015-04-23 17:35:14
阅读次数:
145
Swap Nodes in Pairs
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 u...
分类:
其他好文 时间:
2015-04-23 15:52:23
阅读次数:
186
Assert.assertTrue(tmpEl.getAttribute("class").contains("selected"),"The folder should be highlighted.");Assert.assertFalse(dialog.isDisplayed(),button...
分类:
其他好文 时间:
2015-04-23 15:33:39
阅读次数:
125