[ACWing]1131. Save Private Ryan

Title address: https://www.acwing.com/problem/content/description/1133/ In 1944, special forces Mike received an order from the Ministry of defense to rush to an isolated island in the Pacific Ocean to rescue Private Ryan captured by the enemy. Ryan was imprisoned in a maze with complex terrain, but fortunately Mike got the topographic map of ...

Added by systemtek on Thu, 03 Mar 2022 16:23:46 +0200

Leetcode322: medium, BFS

catalogue 1. Title Description 2. Problem solving analysis 3. Code implementation 1. Title Description Give you an integer array of coins to represent coins of different denominations; And an integer amount, representing the total amount. Calculate and return the minimum number of coins required to make up the total amount. If no combin ...

Added by marco75 on Thu, 24 Feb 2022 03:59:29 +0200

Search algorithms DFS, BFS, backtracking

Deep search Deep search DFS. When a new node is found, it will immediately traverse the new node. It needs to use stack implementation or recursive implementation equivalent to stack. If the parent node of the traversal loop has a different record, it can also be used to detect each parent node. Sometimes we may need to mark the nodes ...

Added by meltingpotclub on Fri, 11 Feb 2022 07:32:19 +0200

Kiner algorithm: deep search (DFS) and wide search (BFS): first understanding the problem state space (hand tearing algorithm)

Guide to series of articles Guide to series of articles Open source project All articles in this series will be included in GitHub for unified collection and management. Welcome ISSUE and Star. GitHub portal: Kiner algorithm preface After understanding the core concept of search algorithm, knowing what problem solving tree is, and masteri ...

Added by scottb1 on Sat, 22 Jan 2022 15:38:33 +0200

Bailian 4116 rescue action & & 4130 Saving Tang Monk&&4115 Naruto and Sasuke simple BFS search question summary and comparison

I Bailian 4116 rescue operation( OpenJudge - 4116: rescue operations) This problem is to add a guard on the basis of simple BFS. Killing a guard also needs + 1. Others can follow the idea of ordinary BFS as usual. The most important thing is that killing a guard can be regarded as a point after twice, so there is no need to deal with killing ...

Added by korion on Fri, 14 Jan 2022 15:16:34 +0200

dfs, bfs (several examples)

preface Tip: the following is the main content of this article. The following cases can be used for reference I P1683 getting started Title Description Not everyone can enter Taohua island. Pharmacist Huang hates people as stupid as Guo Jing. Therefore, he built a path at the only entrance to Taohua Island, which was all paved with ...

Added by jlryan on Sat, 30 Oct 2021 07:06:13 +0300

Introduction to graph theory and implementation of depth first traversal and breadth first traversal

Introduction to graph theory Definition of graph Graph G =(V,E),V is a finite non empty set of vertices, and E is an edge set. V(G) and E(G) represent the vertex set and edge set of G, respectively. Where E(G) can be an empty set. If E(G) is a set of directed edges, then G is a directed graph, otherwise it is an undirected graph. < x, ...

Added by virtual_odin on Sat, 11 Sep 2021 22:34:20 +0300