摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { pub... 阅读全文
posted @ 2017-08-28 13:17 keepshuatishuati 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Although it is a simple question, it must be carefully treated. 阅读全文
posted @ 2017-08-28 13:11 keepshuatishuati 阅读(85) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List> subsetsWithDup(int[] nums) { List> result = new ArrayList(); result.add(new ArrayList()); Arrays.sort(nums); int count = 0; ... 阅读全文
posted @ 2017-08-28 13:00 keepshuatishuati 阅读(94) 评论(0) 推荐(0) 编辑
摘要: class Trie { private TrieNode root; class TrieNode { TrieNode[] children = new TrieNode[26]; boolean isWord; } /** Initialize your data structure here. */ public ... 阅读全文
posted @ 2017-08-28 12:24 keepshuatishuati 阅读(94) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int search(int[] nums, int target) { if (nums.length == 0) { return -1; } int start = 0; int end = nums.length - 1; ... 阅读全文
posted @ 2017-08-28 12:12 keepshuatishuati 阅读(135) 评论(0) 推荐(0) 编辑
摘要: class LRUCache { private int _capacity; private int _currentSize; private Map nodeMap; private Node head; private Node tail; class Node { public int key; publi... 阅读全文
posted @ 2017-08-28 11:50 keepshuatishuati 阅读(96) 评论(0) 推荐(0) 编辑