First knowledge of "backtracking algorithm" and analysis of LeetCode examples

Backtracking algorithm 1. Concept of backtracking algorithm xxxx backtracking algorithm is also called heuristics. It is a method to systematically search the solution of the problem. The basic idea of backtracking algorithm is: go forward from one way, go in if you can, go back if you can't, and try another way. xxxx the above text is so ...

Posted by thyscorpion on Tue, 21 Sep 2021 14:45:07 -0700

C + + language learning summary and experience

        About the language part of C + + (Information Science Orsay one pass), I myself summarized some knowledge.         Because it is too basic, I won't talk about the introduction and use of the first part of the source code.         I'll start with the second chapter, sequent ...

Posted by Onloac on Tue, 21 Sep 2021 14:18:01 -0700

LSNUACM_2021Semester2_Week3Sort -- A - Introduction to sequence blocking 2

Problem solving ideas: First, let's analyze the operation of quary. We query an interval less thanFor non whole blocks, the number of elements is just a violent query, but for the whole block, how can we know how many elements are less than  And? Let's analyze here: if the whole block is disordered, we can only judge whether it meets the ...

Posted by dave914 on Tue, 21 Sep 2021 12:53:21 -0700

Chapter II Data Structure Monotonic Stack and Monotonic Queue

1. Algorithmic ideas The core idea of these two algorithms is: Only those elements that conform to a certain monotonicity are likely to be the answer. Screen out those elements that do not conform to a monotonicity according to the title requirements, store those elements that conform to a certain monotonicity in the stack or queue, and obtain ...

Posted by Trey395 on Tue, 21 Sep 2021 09:40:12 -0700

Dictionary tree implementation of high-performance shielded word algorithm (principle and Implementation)

Some time ago, I saw the violent traversal method used by the company's games to realize the shielding word algorithm of the game. Later, I found that the efficiency of this algorithm is relatively low. Therefore, I learned about the trie tree on the Internet, so now I use the trie tree to realize a shielding word algorithm. Construction pri ...

Posted by vikela on Tue, 21 Sep 2021 04:08:02 -0700

Codeforces Round #743 (Div. 2) (A~C)

Competition link: Click here to transfer Link to official solution: Click here to transfer 1573A Countdown topic link: Click here to transfer Meaning: There is a sequence, you have to change it all into 0. You can perform the following two operations to exchange elements in two positions, which is the last element minus one. Find the minim ...

Posted by fr0mat on Tue, 21 Sep 2021 03:38:55 -0700

Java notes -- process control

Java notes -- process control 1. Sequential structure The basic structure in Java is sequential structure. Unless otherwise specified, it will be executed sentence by sentence in order. Sequential structure is the simplest algorithm structure. Between statements and between boxes, it is carried out in the order from top to bottom. It is co ...

Posted by oakld on Tue, 21 Sep 2021 02:47:34 -0700

Showdown front-end algorithm - Search Search Algorithm - binary search

Index of this series Linear table basis Linked listqueueStack Tree structure foundation Binary treeHeap and priority queueJoint search set Sorting algorithm Quick sortMerge sortCardinality / topological sorting Search Search Algorithm Binary search To be continued Binary search principle Binary search is an algorithm applied to ...

Posted by simenss on Tue, 21 Sep 2021 02:40:42 -0700

leetcode brush record day006:48 and 344

48. Medium difficulty: Requirement: rotate the image in place Method 1: clockwise circulation from outside to inside: class Solution { public void rotate(int[][] matrix) { if(matrix.length == 0 || matrix.length != matrix[0].length) { //If the array passed is not equilateral or the element is 0, it is returned return; ...

Posted by tablex on Tue, 21 Sep 2021 02:01:29 -0700

On Mobius function & Inclusion exclusion theorem (example: number coloring, complete square number)

Today, I spent a day grinding Mobius function and did two questions. I have a lost understanding of Mobius. If I want to take notes, I'll write this blog First, let's introduce what is an integral function. When gcd(a,b)=1 and f(a,b)=f(a)*f(b), f(x) is an integral function. For any a and B, f(a,b)=f(a)*f(b), it is called a complete integral fu ...

Posted by ardyandkari on Tue, 21 Sep 2021 01:33:37 -0700