05 2016 档案
摘要:Implement a trie with insert, search, and startsWith methods. Note:You may assume that all inputs are consist of lowercase letters a-z. Subscribe to s
阅读全文
摘要:Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n
阅读全文
摘要:1. How to create generic array List<Integer>[] array = new List[len]; import java.lang.reflect.Array; ArrayList<Integer>[] array = (ArrayList<Integer>
阅读全文
摘要:17. Letter Combinations of a Phone Number Given a digit string, return all possible letter combinations that the number could represent. A mapping of
阅读全文
摘要:46. Permutations Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3]
阅读全文
摘要:284. Peeking Iterator Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the pe
阅读全文
摘要:136. Single Number Given an array of integers, every element appears twice except for one. Find that single one. Your algorithm should have a linear r
阅读全文
摘要:286. Missing Number Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,
阅读全文
摘要:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum
阅读全文
摘要:Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng
阅读全文
摘要:2. Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their node
阅读全文

浙公网安备 33010602011771号