LeetCode –Binary Tree Postorder Traversal

Given a binary tree, return the _postorder_ traversal of its nodes' values. Example: Input:  [1,null,2,3] \\ / Output:  [3,2,1] Follow up: Recursive solution…

2020-06-04 · 1 分钟

LeetCode –Binary Tree Preorder Traversal

Given a binary tree, return the _inorder_ traversal of its nodes' values. Example: Input: Output: Follow up: Recursive solution is trivial, could you do it…

2020-04-16 · 1 分钟

LeetCode – Keys and Rooms

There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next room.…

2020-01-14 · 2 分钟

LeetCode – 01 Matrix

LeetCode – Matrix - Given a matrix consists of and 1, find the distance of the nearest for each cell

2019-12-30 · 2 分钟

LeetCode – Flood Fill

An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from to 65535). Given a coordinate (sr, sc) …

2019-11-03 · 2 分钟

LeetCode – Decode String

Given an encoded string, return its decoded string

2019-10-16 · 2 分钟

LeetCode – Implement Stack using Queues

Implement the following operations of a stack using queues. - push(x) -- Push element x onto stack. - pop() -- Removes the element on top of the stack. - top()…

2019-10-07 · 2 分钟

LeetCode – Implement Queue using Stacks

Implement the following operations of a queue using stacks. - push(x) -- Push element x to the back of queue. - pop() -- Removes the element from in front of…

2019-09-08 · 2 分钟

LeetCode – Binary Tree Inorder Traversal

Given a binary tree, return the _inorder_ traversal of its nodes\\' values. Example: Input: Output: Follow up: Recursive solution is trivial, could you do it…

2019-08-31 · 2 分钟

LeetCode – Target Sum

You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have symbols + and -. For each integer, you should choose one from + …

2019-08-20 · 2 分钟