Deep first search (DFS), read this article is enough.

1, Definition: The idea of depth first search is very similar to the pre order traversal of the tree. The following is the definition on Baidu Encyclopedia: The method of depth first traversing the graph is to start from a vertex v in the graph: (1) Access vertex v; (2) Starting from the unreachable adjacency points of v, the depth of ...

Added by Ali_baba on Fri, 11 Feb 2022 11:22:00 +0200

Graph analysis (coduck)

catalogue Concept of graph Storage mode of graph adjacency matrix Title: adjacency matrix representation of Graphs Adjacency table Title: the forward star of a graph represents 1 ergodic Depth first search Breadth first search Shortest path algorithm Dijkstra algorithm Title: Party Bellman Ford algorithm SPFA algorithm Title: ma ...

Added by siwelis on Fri, 11 Feb 2022 11:00:02 +0200

Understand the factory model

3. Factory series First of all, any method or class that can generate an object can be called a factory (as long as a method returns a new object, it can be said to be a factory). Therefore, a singleton is also a factory (static factory)Why is there a factory when there is new? Flexible control of production processPermission, decoration, l ...

Added by Tindo on Fri, 11 Feb 2022 10:37:50 +0200

Sum of two lecodes II-167

Give you an integer array numbers with subscript starting from 1. The array has been arranged in non decreasing order. Please find two numbers in the array that meet the sum of addition and equal to the target number target. If the two numbers are numbers[index1] and numbers[index2] respectively, then 1 < = index1 < index2 < = numbers ...

Added by laradg on Fri, 11 Feb 2022 10:19:41 +0200

Python digital analog notes Sklearn sample cluster analysis

1. Classification of classification Classification of classification? Yes, there are different kinds of classification, and it is often confused in the fields of mathematical modeling and machine learning. First of all, let's talk about Supervised learning and Unsupervised learning. Does it mean that there are no teachers and Discipline Inspe ...

Added by semlabs on Fri, 11 Feb 2022 09:33:14 +0200

Data structure algorithm design problem

Linear table 1. The linear table with known length n adopts sequential storage structure. Write an algorithm to delete all elements with the value of x in the linear table. Method 1: record the number of elements equal to X in the sequence table l with k, count k while scanning L, move the elements not equal to x forward k positions, and fina ...

Added by nahla123 on Fri, 11 Feb 2022 08:53:06 +0200

LeetCode question brushing - Summary of sword finger offer stack and queue questions

Sword finger Offer 09 Queue with two stacks subject Implement a queue with two stacks. The declaration of the queue is as follows. Please implement its two functions appendTail and deleteHead to insert integers at the end of the queue and delete integers at the head of the queue respectively. (if there are no elements in the queue, the del ...

Added by likwidmonster on Fri, 11 Feb 2022 07:33:24 +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

Summary of knapsack problem

Classification of knapsack problems: 1. 01 knapsack problem 2. Complete knapsack problem 3. Multiple knapsack problem 4. Complete knapsack problem Solutions to DP problems: 01 knapsack problem Problem Description: see example: 01 knapsack problem Problem analysis: for each item, you can choose to or not. Therefore, the calculation of state i ...

Added by littlepeg on Fri, 11 Feb 2022 06:26:49 +0200

PaddleX model, C + + deployment, python/c + + interaction

After the PaddleX model is deployed in C + +, Python calls and reads the data returned from the dll Tip: you can add the directories of all articles in the series here. You need to add the directories manually For example: the first chapter is the use of pandas, an introduction to Python machine learning Tip: after writing the article, the ...

Added by cueball2000uk on Fri, 11 Feb 2022 05:45:05 +0200