Month: July 2018

Leetcode 111. Minimum Depth of Binary Tree 深度优先递归遍历

Leetcode 111. Minimum Depth of Binary Tree 深度优先递归遍历

题意分析 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note: A leaf is a node with no children. Example: Given binary tree [3,9,20,null,null,15,7], 

Leetcode 107 Binary Tree Level Order Traversal II 层次遍历及其变形

Leetcode 107 Binary Tree Level Order Traversal II 层次遍历及其变形

题目分析 Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its bottom-up 

Leetcode 103 Binary Tree Zigzag Level Order Traversal 层次遍历变形

Leetcode 103 Binary Tree Zigzag Level Order Traversal 层次遍历变形

题目表述 Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 

First Time with Akaso Brave 4K on the bike

First Time with Akaso Brave 4K on the bike

Biking from my apartment to mountainview public library in the sunshine.

Leetcode 444 Sequence Reconstruction 字符串化用拓扑排序

Leetcode 444 Sequence Reconstruction 字符串化用拓扑排序

题目表述 Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 104. Reconstruction means building a shortest common supersequence of the sequences 

Leetcode 207 Course Schedule 判断有向图是否有环

Leetcode 207 Course Schedule 判断有向图是否有环

题目表述 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] Given the total 

Leetcode 210 Course Schedule 拓扑排序

Leetcode 210 Course Schedule 拓扑排序

题目表述 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] Given the total