Deep first search Luogu P1123 retrieval game problem solving ideas

I sprout a new one. If there is something wrong, please leave a message in the comment area. (。・∀・)ノ゙ subject An N × For the number matrix composed of non negative integers of M, you need to take out several numbers so that any two numbers taken out are not adjacent (if a number is adjacent to another number in one of the 88 grids ...

Posted by zingbats on Mon, 03 Jan 2022 00:06:18 +0100

Dictionary tree (prefix tree)

Dictionary tree (prefix tree) summary: The dictionary tree (Trie) is used to determine whether a string exists or has a string prefix. Why do we need a dictionary tree to solve this kind of problem? If we have a dictionary that stores nearly 10000 words, even if we use hash, the actual cost of searching for a word in it is very lar ...

Posted by raker7 on Sun, 02 Jan 2022 23:51:42 +0100

Chapter 9 - linear table lookup

lookup The definition of search is the process of finding the element with keyword k in the data structure storing several elements. If the table is modified during the lookup process, it is called a dynamic lookup table, otherwise it is a static lookup table. PI is the probability of finding the ith element in the table, ci is the number of ...

Posted by Johnain on Sun, 02 Jan 2022 21:09:55 +0100

Principle and implementation of MD5 encryption algorithm

Principle and implementation of MD5 encryption algorithm   MD5 message digest algorithm belongs to Hash algorithm. MD5 algorithm runs the message with arbitrary length to generate a 128 bit message summary. The message length and filling data described below are in bits, and the byte order is small end bytes. Algorithm principle 1. Data filli ...

Posted by arion279 on Sun, 02 Jan 2022 20:37:40 +0100

Linear DP solves the respective selection problem (grid access, ZG and GG paper transfer, paper transfer)

Original title link: Grid access Grid access Classification: two dimensional can enter a point repeatedly without repeated calculation Set n × In the square graph of N, we fill some squares with positive integers, while others with the number 0. As shown in the figure below: Starting from the upper left corner A in the figure, someone ca ...

Posted by paruby on Sun, 02 Jan 2022 19:22:03 +0100

Monthly competition of ACM training team of Taizhou University (New Year's Day venue)

The game address is stamped here 1001: math problem: Find the limit: 1002: Maoming's achievements Solution: For an item i, we can choose its first achievement, or choose the second achievement, or not, so that we can use dfs to traverse all situations. The time complexity is O (3 ^ 10) #include<bits/stdc++.h> using namespace std; ...

Posted by alvinkoh on Sun, 02 Jan 2022 17:49:12 +0100

Red black tree learning

balanced binary tree In order to avoid the phenomenon of "lameness", reduce the height of the tree and improve our search efficiency, there is another tree structure: "balanced binary tree" is called AVl tree on the right Rule: the absolute value of the height difference between the left and right subtrees is no more than ...

Posted by Chetan on Sun, 02 Jan 2022 17:21:49 +0100

Leetcode question brushing diary: 11-15 questions

brief introduction The author graduated from Xi'an Jiaotong University in 2021 and will continue to study postgraduate in this university in September of the same year. After experiencing the intense and exciting job search process of some students around him, the 60w + offer and 30w offer are greatly related to his ability to tear the cod ...

Posted by malikah on Sun, 02 Jan 2022 14:29:47 +0100

Data structure - stack (Ⅳ)

Data structure - stack (Chapter 3) sorting notes. If there are errors, please correct them. Sequence table Single linked list Stack of base book exercise do ...

Posted by EGNJohn on Sun, 02 Jan 2022 13:39:37 +0100

Using Python to implement several common sorting algorithms

1, Overview of sorting algorithms Insert sort: direct insert sort, dichotomy insert sort Select sort: directly select sort, heap sort Swap sort: bubble sort, quick sort Merge sort 2, Code implementation 1. Insert sorting directly In the simplest and direct way, the sequence can be divided into the sorted part on the left and the unorde ...

Posted by freephoneid on Sun, 02 Jan 2022 12:56:39 +0100