- 博客(174)
- 收藏
- 关注
转载 3Sum
3Sum 1 public class Solution { 2 public ArrayList<ArrayList<Integer>> threeSum(int[] num) { 3 if(num =...
2013-12-24 06:24:00
92
转载 Visitor
Visitor Visitor:Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new opera...
2013-12-04 16:30:00
102
转载 Memento
Memento Memento:Without violating encapsulation, capture and externalize an object's internal state so that the object can be rest...
2013-12-04 16:13:00
90
转载 Mediator Pattern
Mediator Pattern Mediator:Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by ke...
2013-12-04 16:11:00
104
转载 Interpreter
Interpreter Interpreter:Given a language, define a representation for its grammar along with an interpreter that uses the represen...
2013-12-04 16:08:00
122
转载 Prototype
Prototype Prototype: Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this ...
2013-12-04 15:38:00
69
转载 Builder Pattern
Builder Pattern Builder:Separate the construction of a complex object from its representation so that the same construction proces...
2013-12-04 15:05:00
89
转载 Chain of Responsibility
Chain of Responsibility Chain of Responsibility:Avoid coupling the sender of a request to its receiver by giving more than one obje...
2013-12-04 15:01:00
87
转载 Flyweight
Flyweight Flyweight:Use sharing to support large numbers of fine-grained objects efficiently. ...
2013-12-04 14:31:00
85
转载 Bridge Pattern
Bridge Pattern The Bridge Pattern:Decouple an abstraction from its implementation so that the two can vary independently. ...
2013-12-04 14:17:00
71
转载 Proxy Pattern
Proxy Pattern The Proxy Patternprovides a surrogate or placeholder for another object to control access to it. ...
2013-12-04 13:28:00
76
转载 State Pattern
State Pattern The State Patternallows an object to alter its behavior when its internal state changes. The object will appear to c...
2013-12-04 12:33:00
84
转载 Composite Pattern
Composite Pattern The Composite Patternallows you to compose objects into tree structures to represent part-whole hierarchies. Com...
2013-12-04 10:31:00
70
转载 Iterator Pattern
Iterator Pattern The Iterator Pattern provides a way to access the elements of an aggregate object sequentially without exposing it...
2013-12-04 10:11:00
56
转载 Template Method Pattern
Template Method Pattern The Template Method Patterndefines the skeleton of an algorithm in a method, deferring some steps to subcl...
2013-12-03 15:56:00
75
转载 Facade Pattern
Facade Pattern The Facade Patternprovides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level...
2013-12-03 14:49:00
59
转载 Adapter Pattern
Adapter Pattern The Adapter Patternconverts the interface of a class into another interface the clients expect. Adapter lets class...
2013-12-03 14:20:00
80
转载 Command Pattern
Command Pattern The Command Patternencapsulates a request as an object, thereby letting you parameterize other objects with differ...
2013-12-03 10:17:00
57
转载 Singleton Pattern
Singleton Pattern The Singleton Patternensures a class has only one instance, and provide a global point of access to it. ...
2013-12-02 16:19:00
55
转载 Abstract Factory Pattern
Abstract Factory Pattern The Abstract Factory Pattern provides an interface for creating families of related or dependent objects w...
2013-12-02 15:32:00
73
转载 Factory Method Pattern
Factory Method Pattern The Factory Method Pattern defines an interface for creating an object, but lets subclasses decide which cl...
2013-12-02 13:09:00
80
转载 Decorator Pattern
Decorator Pattern The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a...
2013-12-02 12:21:00
58
转载 Observer Pattern
Observer Pattern The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all o...
2013-12-02 08:37:00
77
转载 Copy List with Random Pointer
Copy List with Random Pointer 1 /** 2 * Definition for singly-linked list with a random pointer. 3 * class RandomListNode {...
2013-12-01 13:18:00
45
转载 Two Sum
Two Sum 1 public class Solution { 2 public int[] twoSum(int[] numbers, int target) { 3 HashMap<Integer, Integer...
2013-11-30 14:29:00
92
转载 Add Two Numbers
Add Two Numbers 1 public class Solution { 2 public ListNode addTwoNumbers(ListNode l1, ListNode l2) { 3 if(l1 == n...
2013-11-30 13:23:00
57
转载 Longest Consecutive Sequence
Longest Consecutive Sequence 1 public class Solution { 2 public int longestConsecutive(int[] num) { 3 // IMPORTANT...
2013-11-28 08:41:00
61
转载 Evaluate Reverse Polish Notation
Evaluate Reverse Polish Notation String equals() == 1 public class Solution { 2 public int evalRPN(String[] tokens) { 3 ...
2013-11-28 02:44:00
61
转载 Minimum Depth of Binary Tree
Minimum Depth of Binary Tree 1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * ...
2013-11-26 06:45:00
53
转载 Single Number II
Single Number II 1 public class Solution { 2 public int singleNumber(int[] A) { 3 // IMPORTANT: Please reset any m...
2013-11-25 09:01:00
64
转载 Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock 1 public class Solution { 2 public int maxProfit(int[] prices) { 3 // IMPORTANT: P...
2013-11-24 17:14:00
54
转载 Linked List Cycle
Linked List Cycle 1 /** 2 * Definition for singly-linked list. 3 * class ListNode { 4 * int val; 5 * ListNode ...
2013-11-24 09:19:00
50
转载 Single Number
Single Number bit manipulation 1 public class Solution { 2 public int singleNumber(int[] A) { 3 // IMPORTANT: Ple...
2013-11-24 08:57:00
69
转载 Max Points on a Line
Max Points on a Line be careful when x1 = x2 1 /** 2 * Definition for a point. 3 * class Point { 4 * int x; 5 * ...
2013-11-24 08:43:00
62
转载 Strategy
Strategy Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary...
2013-11-22 16:31:00
53
转载 LRU Cache
LRU Cache 1 public class LRUCache { 2 3 private int capacity; 4 private Map<Integer, Entry> nodes; 5 ...
2013-11-22 02:40:00
59
转载 Word Break II
Word Break II 1 public class Solution { 2 public ArrayList<String> wordBreak(String s, Set<String> dict) { 3 ...
2013-11-22 02:37:00
63
转载 Text Justification
Text Justification 1 public class Solution { 2 public ArrayList<String> fullJustify(String[] words, int L) { 3 ...
2013-11-22 02:33:00
56
转载 Median of Two Sorted Arrays
Median of Two Sorted Arrays 1 public class Solution { 2 public double findMedianSortedArrays(int A[], int B[]) { 3 ...
2013-11-22 02:28:00
77
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人