摘要:
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { pub... 阅读全文
摘要:
Although it is a simple question, it must be carefully treated. 阅读全文
摘要:
class Solution { public List> subsetsWithDup(int[] nums) { List> result = new ArrayList(); result.add(new ArrayList()); Arrays.sort(nums); int count = 0; ... 阅读全文
摘要:
class Trie { private TrieNode root; class TrieNode { TrieNode[] children = new TrieNode[26]; boolean isWord; } /** Initialize your data structure here. */ public ... 阅读全文
摘要:
class Solution { public int search(int[] nums, int target) { if (nums.length == 0) { return -1; } int start = 0; int end = nums.length - 1; ... 阅读全文
摘要:
class LRUCache { private int _capacity; private int _currentSize; private Map nodeMap; private Node head; private Node tail; class Node { public int key; publi... 阅读全文