OK, I specifically learned the knowledge of stack and queue. Then the main content of this blog is to do three OJ questions. After learning, we must brush the questions in time to deepen our understanding and consolidation. Otherwise, it is difficult to make progress, which is conducive to our better learning of stack and queue of ...
Posted by PHP_TRY_HARD on Fri, 15 Apr 2022 03:00:49 +0300
1178. Crossword puzzles
A foreign friend has designed an English version of a crossword puzzle game based on Chinese crossword puzzles. Please guess.
The puzzle of a word puzzle is given in the form of a string. If a word word meets the following two conditions, it can be counted as the answer:
The word word word contains the first letter of ...
Posted by olivarespablo on Fri, 15 Apr 2022 02:49:09 +0300
Subsequence problem is a common algorithm problem. Subsequence problem itself is more difficult than substring and subarray, because the former is a discontinuous sequence, and the latter two are continuous. Even exhaustive is not easy, let alone solving relevant algorithm problems.
The subsequence problem is likely to involve two strings. For ...
Posted by Scooby08 on Thu, 14 Apr 2022 09:58:09 +0300
[LeetCode] sword finger Offer Chapter IV ⊰⊰⊰ questions 32 - 38
32-Ⅰ. Print a binary tree (medium) from top to bottom
Sword finger Offer 32 - I. print binary tree from top to bottom
[title] print each node of the binary tree from top to bottom, and the nodes of the same layer are printed from left to right.
Given binary tree: ...
Posted by jefkin on Thu, 14 Apr 2022 07:51:10 +0300
1. Title Description
Give you a directed acyclic graph (DAG) with # n # nodes. Please find all the paths from node # 0 # to node # n-1 # and output them (not in a specific order)
graph[i] is a list of all nodes that can be accessed from node # I # (that is, there is a directed edge from node # I # to node # graph[i][j]).
Posted by sanchez77 on Thu, 14 Apr 2022 03:17:22 +0300
I'll give you a pile of tasks to complete. Can you finish all the tasks on time?
Tip: interview questions before Huawei 202204 It is similar to arranging meetings, waiting in line to finish washing, waiting in line to make coffee and other problems to test the skilled use of small root piles
Give you an N*2 array arr, which re ...
Posted by neville on Wed, 13 Apr 2022 18:31:40 +0300
04. Find in 2D array
In an n * m two-dimensional array, each row is sorted in ascending order from left to right, and each column is sorted in ascending order from top to bottom. Please complete an efficient function, input such a two-dimensional array and an integer, and judge whether the array contains the integer.
Posted by srdva59 on Wed, 13 Apr 2022 16:54:55 +0300
Last time, I talked about what a tree is. In this article, I'll talk about what a binary tree is and how it should be implemented.
What is a binary tree
Concept of binary tree
Binary tree is a tree with a degree of 2 in practical and simple terms. That is, each node of the tree has at most two child nodes.
The following figure clearly sh ...
Posted by Kibeth on Wed, 13 Apr 2022 14:32:39 +0300
🥪 Write in front
Hello, friends 😋， I'm saury 🐟， A new blogger active in Java area and algorithm area~
Welcome to the algorithm learning community of colleges and universities 🏰: https://bbs.csdn.net/forums/Suanfa , the leaders in the community gather, and we exchange and learn from each other!
From today on, I w ...
Posted by justsomeone on Wed, 13 Apr 2022 03:23:48 +0300
See this chapter for the basic knowledge of bit operation Blog
leetcode765. Lovers holding hands
N couples sit in 2N consecutive seats and want to hold each other's hand. Calculate the minimum number of seat exchanges so that each couple can sit side by side. You can choose any two people in one exchange and ask them to s ...
Posted by Saethyr on Tue, 12 Apr 2022 10:14:57 +0300