摘要:
题目: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] 阅读全文
摘要:
题目: Design a data structure that supports the following two operations: search(word) can search a literal word or a regular expression string containi 阅读全文
摘要:
题目: Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in t 阅读全文
摘要:
题目: Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be i 阅读全文
摘要:
题目: Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- 阅读全文
摘要:
题目: Implement a trie with insert, search, and startsWith methods. Note:You may assume that all inputs are consist of lowercase letters a-z. 题意及分析:实现一个 阅读全文
摘要:
题目: Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). G 阅读全文
摘要:
一、图的分类 1、无向图:边没有方向的图称为无向图。如<A,B>和<B,A>等价。下图是一个无向图,及其邻接链表和邻接矩阵的表示。 2、有向图: 边是有方向性的,例如一条边有两个顶点A,B,A和B顶点之间,A指向了B,B也指向了A,两者是不同的,如果给边赋予权重,那么这种异同便更加显著了。下图是一个 阅读全文
摘要:
题目: Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the 阅读全文
摘要:
题目: For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible r 阅读全文