码迷,mamicode.com
首页 >  
搜索关键字:should    ( 4948个结果
LeetCode 146 LRU Cache
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 ...
分类:系统相关   时间:2014-10-22 12:56:02    阅读次数:274
软件架构设计的六大原则
1.“开-闭”原则(OCP) Software entities should be open for extension, but closed for modification. 对扩展开放,对修改封闭。2.里氏代换原则(LSP) 凡是基类适用的地方,子类一定适用。3.依赖倒转原则(DIP) 要...
分类:其他好文   时间:2014-10-22 10:49:09    阅读次数:221
Single Number 数组中除了某个元素出现一次,其他都出现两次,找出这个元素
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:编程语言   时间:2014-10-21 22:53:06    阅读次数:316
Unique Binary Search Tree II | LeetCode
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni...
分类:其他好文   时间:2014-10-21 22:48:09    阅读次数:266
LeetCode Two Sum
Two Sum Total Accepted: 37848 Total Submissions: 206006 Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return ...
分类:其他好文   时间:2014-10-21 21:44:10    阅读次数:267
rspec subject{}和it{}
subject { build(:user,firstname:'john',lastname:'doe')}it { should be_named 'john doe'}it{}和subject{}互为别名Gem扩展代码库 shoulda-matchers直接使用subject { Contac...
分类:其他好文   时间:2014-10-21 15:22:02    阅读次数:216
[Leetcode] Merge Two Sorted Lists
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.Solution:...
分类:其他好文   时间:2014-10-21 02:17:26    阅读次数:157
[Leetcode] 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->1->4->3.Your algor...
分类:其他好文   时间:2014-10-21 02:14:37    阅读次数:266
[LeetCode]Merge Two Sorted Lists
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. /** * Definition for singly-linked list. * publ...
分类:其他好文   时间:2014-10-20 21:28:05    阅读次数:233
leetcode第23题--Swap Nodes in Pairs
Problem: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.Yo...
分类:其他好文   时间:2014-10-20 13:15:42    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!