Shortest circuit ----- dijkstra (single source shortest circuit)

1, dijkstra algorithm The single source shortest path algorithm has the lowest complexity among the four basic shortest path algorithms, but it is not suitable for graphs with negative weight edges. Greedy thought, from the beginning to the end, a layer of ergodic graph. The shortest path from the starting point to any point can be found ...

Posted by xnowandtheworldx on Thu, 06 Jan 2022 16:05:01 +0100

PTA class B 1100 school celebration (25 points)

Zhejiang University will celebrate its 122nd anniversary in 2019. In order to prepare for the anniversary, Alumni Association collects all alumni ID number. Now you need to write a program to identify all the alumni according to the ID number of all the people who attend the celebration. Input format: The input is given a positive integer N o ...

Posted by phpvolution on Thu, 06 Jan 2022 15:57:10 +0100

[artificial intelligence] utilization α-β Search the game tree algorithm to write a word chess game (QDU)

Experimental purpose Understand and master the heuristic search process of game tree, and be able to realize simple game with selected programming language. Learning minimax search and α − β \alpha-\beta ...

Posted by WhiteCube on Thu, 06 Jan 2022 15:42:13 +0100

python game development (Snake game, Gobang game, big ball eating small ball game)

catalogue 1, Game development using Pygame 1. Make game window 2. Drawing in a window 3. Load image 4. Achieve animation effect 5. Collision detection 6. Event handling 2, Gobang 3, Snake game 1, Game development using Pygame Pygame is an open source Python module, which is specially used for the development of multimedia applicatio ...

Posted by phillfox on Thu, 06 Jan 2022 15:35:30 +0100

[Codeforces]Hello 2022(A-C) problem solution

Better reading experience: http://www.abmcar.top/archives/codeforceshello2022 Complete source code: https://github.com/abmcar/ACM/tree/master/OpenjudgeNow/Codeforces/Hello%202022 Tip from the front row: the questions in this field are very disgusting and are not recommended A. Stable Arrangement of Rooks Main idea of the topic: give you a bo ...

Posted by JackSevelle on Thu, 06 Jan 2022 15:20:18 +0100

One formula is enough for backtracking algorithm

catalogue Two universal templates 1. Subset 2. Subset II 3. Combination 4. Combination sum 5. Combined sum II 6. Full arrangement 7. Full arrangement II 8. Full arrangement of strings 9. Letters are arranged in full case Two universal templates Method 1: the relative order remains unchanged Go from left to right start Number of con ...

Posted by BRUm on Thu, 06 Jan 2022 12:50:41 +0100

[data structure and algorithm] linked list and bidirectional linked list

Linked list Like arrays, linked lists can be used to store a series of elements, but the implementation mechanism of linked lists and arrays is completely different classification - Unidirectional linked list - Bidirectional linked list - One way circular linked list - Bidirectional circular linked list Arrays and linked lists ...

Posted by tjodolv on Thu, 06 Jan 2022 12:29:49 +0100

Binary sort tree (implemented in java code) constructs a binary sort tree, traverses the binary sort tree, finds and deletes nodes

Define tree nodes Define the attributes of tree nodes and the middle order traversal method class Node { int value; Node left; Node right; public Node(int value) { this.value = value; } //Medium order traversal //The result of a binary tree traversed in middle order is ordered public void infixOrder() { ...

Posted by kawai84 on Thu, 06 Jan 2022 10:34:42 +0100

[data structure and algorithm] hash table

Hashtable Hash table -- hash table Hash table is a very important data structure. Almost all programming languages use or indirectly use hash tableIts structure is an array, but its difference from the array is the transformation of the subscript value, which is called the hash function, and the HashCode is obtained through the hash fu ...

Posted by yelvington on Thu, 06 Jan 2022 09:59:35 +0100

[jloi2016 / show2016] reconnaissance guard (tree DP)

Considering the tree DP, suppose we have considered the placement of listening points in the current subtree, and the root is u u u. Consider what status we want to record: u u u how fa ...

Posted by Canabalooza on Thu, 06 Jan 2022 04:43:05 +0100