摘要: In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this n 阅读全文
posted @ 2018-12-24 07:58 Hygeia 阅读(266) 评论(0) 推荐(0) 编辑
摘要: In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N nodes (wi 阅读全文
posted @ 2018-12-24 06:58 Hygeia 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Example 2: This questio 阅读全文
posted @ 2018-12-20 10:11 Hygeia 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2018-12-09 06:31 Hygeia 阅读(170) 评论(0) 推荐(0) 编辑
摘要: REFERENCE: https://blog.csdn.net/fuxuemingzhu/article/details/70241424 Given a binary tree, flatten it to a linked list in-place. For example, given t 阅读全文
posted @ 2018-12-06 10:01 Hygeia 阅读(113) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2018-12-03 11:49 Hygeia 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any 阅读全文
posted @ 2018-12-02 09:44 Hygeia 阅读(102) 评论(0) 推荐(0) 编辑
摘要: A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2018-12-02 01:29 Hygeia 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. Example 1: Example 2: Example 3 阅读全文
posted @ 2018-11-30 08:03 Hygeia 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Every email consists of a local name and a domain name, separated by the @ sign. For example, in alice@leetcode.com, alice is the local name, and leet 阅读全文
posted @ 2018-11-30 02:05 Hygeia 阅读(176) 评论(0) 推荐(0) 编辑