摘要:
165. Compare Version Numbers class Solution { public int compareVersion(String version1, String version2) { String[] levels1 = version1.split("\\."); 阅读全文
摘要:
208. Implement Trie (Prefix Tree) class TrieNode{ private char val; public boolean isWord; public TrieNode[] children = new TrieNode[26]; public TrieN 阅读全文
摘要:
382. Linked List Random Node class Solution { ListNode node; Random random; /** @param head The linked list's head. Note that the head is guaranteed t 阅读全文
摘要:
215. Kth Largest Element in an Array 快速排序法,选择一个数,比这个数大的交换到左边,比这个数小的交换到右边。 class Solution { public int findKthLargest(int[] nums, int k) { shuffle(nums 阅读全文
摘要:
155. Min Stack class MinStack { int min = Integer.MAX_VALUE; Stack<Integer> stack = new Stack<Integer>(); /** initialize your data structure here. */ 阅读全文