Recently in brush force buckle binary tree related problems, found that many problems need to be solved by recursion, or many problems solved by recursion...
Each sequence of legal parentheses can be generated by the above rules. Iterate backwards from the first character, hitting '(',count+1, otherwise count-1. Save with Max,...
Easy questions. I have something to do tonight, so LET's start with one. Double pointer, traversal exchange can be. Next time, change the topic into...
This article introduces the basic knowledge of linked list structure, single linked list inversion. This knowledge point is also often used by companies as a...
Two-dimensional depth-first search problem requires a Visited array to indicate whether each node has been visited. All nodes are detected, but only a depth-first search...
Today is the 19th issue, strive for a daily issue, at most two days, welcome everyone to supervise me... The initial initialization process creates a...
Nuggets team number online, help you Offer impromptu! Given a string containing only '(' and ')', find the longest valid (well-formed and continuous) parenthesis substring....
This is the 14th day of my participation in the Last Revision Challenge of November 2021. The last Revision Challenge of 2021 @TOC topic Information...
In my last blog post, LeetCode Advanced 944- Greedy, a friend suggested that 944 is not very representative of understanding greedy algorithms. After reviewing the...
Small knowledge, big challenge! This article is participating in the creation activity of "Essential Tips for Programmers". Given an array of integers in ascending order,...
Given a binary tree, you need to find the depth from the root to the nearest leaf. DFS (Recursive traversal) with queue simulation hierarchy traversal...