Search (part of the real problem)
Crop hybridization
Title Description
Crop hybridization is an important step in crop cultivation. There are ^ crops (numbered ^ 1 ^ to ^ n) known, and the time from sowing to maturity of ^ i ^ crop is ^ Ti. Crops can be hybridized in pairs, and the longer of the two kinds of time is taken as the hybridization time. If the planting time ...
Posted by influx on Wed, 09 Mar 2022 08:53:51 +0100
Blue Bridge Cup AcWing learning notes 4-1 learning of enumeration (with relevant Blue Bridge real questions: concatenated interval number, increasing triplet, sum of special numbers) (Java)
Students who participate in the blue bridge cup can pay attention to the blogger. The blogger is also preparing the Blue Bridge Cup and can brush questions with the blogger's blog.
Blue Bridge Cup
My AcWing
The title and pictures are from the counseling class of group ab of Blue Bridge Cup C + +
enumeration
Enumeration, as the name su ...
Posted by Elusid on Mon, 07 Mar 2022 09:10:43 +0100
Breadth first search depth first search dynamic programming LeetCode topic: transmitting information
original text https://lwebapp.com/zh/post/l...problemChild A is playing A message passing game with his friends. The rules of the game are as follows:There are n players. All players are numbered 0 ~ n-1 respectively, of which the number of child A is 0Each player has A fixed number of other players who can transmit information (or not). The re ...
Posted by koglakci on Tue, 01 Mar 2022 08:20:37 +0100
Share two common search algorithms: BFS and DFS
This article is shared from Huawei cloud community< Preliminary study on BFS and DFS algorithms >, author: ayin.
This time I share two common search algorithms 1.BFS is breadth first search 2.DFS is depth first search
Number of islands
Given a two-dimensional grid consisting of '1' (land) and '0' (water), calculate the number of island ...
Posted by Roble on Mon, 28 Feb 2022 02:19:13 +0100
JAVA exercise 114 - cat and mouse
The two players play the role of cat and mouse respectively, and play the game on an undirected graph. They take turns.
The form of graph is: graph[a] is a list, which is composed of all nodes b satisfying that ab is an edge in the graph.
The mouse starts from node 1 and starts first; The cat starts from node 2 and starts the second. There is ...
Posted by drunknbass on Sat, 12 Feb 2022 13:22:55 +0100
Depth first search - maze problem (jisuanke - Blue Bridge Cup national competition training camp)
Depth first search maze problem
Video learning link: https://www.bilibili.com/video/BV1pk4y1z76B Depth first search: referred to as dfs, is a classic search algorithm.
Recursive review
We have studied recursion before. We have implemented some algorithms using recursion:
# 1. Recursive factorial
# n! = 1*2*3*4******n
def factorial(n):
...
Posted by leap500 on Wed, 09 Feb 2022 08:09:01 +0100
Xinao 1215: maze (explain the restoration of tag array in detail)
1215: Maze
Time limit: 1000 ms memory limit: 65536 KB
[Title Description] One day, while exploring in the forest, extende accidentally walked into a maze, which can be seen as a maze by n × n Each grid point has only two states And #, the former means passable, and the latter means impassable. At the same time, when extend is at A ...
Posted by t31os on Tue, 08 Feb 2022 17:34:13 +0100
Depth first search pruning (jisuanke - Lanqiao cup national competition training camp)
Depth first search pruning
We have learned that the search process will eventually generate a search tree. Pruning, as the name suggests, is to cut down unnecessary subtrees on the search tree through some judgment. Sometimes, we will find that the state of the subtree corresponding to a node is not the result we want, so we don't need to ...
Posted by dch27 on Tue, 08 Feb 2022 10:16:39 +0100
LeetCode sword finger Offer II retrospective summary
📚 Blog home page: ⭐ This is a little Yibai blog duck~ ⭐ ️👉 Welcome to pay attention ❤️ give the thumbs-up 👍 Collection ⭐ Comments 📝😜 Xiaoyibai is preparing for his internship. He often updates the interview questions and LeetCode solutions. Friends with similar interests are welcome to communicate with each other~ 💙 If you have any ...
Posted by Loryman on Wed, 26 Jan 2022 00:21:48 +0100
Data structure and algorithm: Fig
chart
1, Figure basic introduction
1. Why is there a map
We learned linear tables and trees earlierThe linear table is limited to the relationship between a direct precursor and a direct successorThe tree can only have one direct precursor, that is, the parent nodeWhen we need to represent many to many relationships, we use graphs here.
2. ...
Posted by switchdoc on Wed, 19 Jan 2022 13:53:26 +0100