Summary of binary search exercises

Binary Search, also known as Binary Search, is an efficient search method. However, the half search requires that the linear table must be used Sequential storage structure And the elements in the table are arranged in order by keywords. General binary search template int binarySearch(vector<int>& nums, int target){ if(nums.size() ...

Added by TKKP on Mon, 07 Feb 2022 08:55:10 +0200

Basic dynamic programming -- knapsack problem

The knapsack problem is divided into 01 knapsack problem and complete knapsack problem. The knapsack problem, in the words of a certain respondent, is: a thief carried a knapsack and sneaked into the gold store. The bag is so big. How can he ensure that all the items he carried are of the greatest value Principle of dynamic programming Simi ...

Added by Bricktop on Mon, 07 Feb 2022 08:05:58 +0200

Linear list - single linked list - array

Linear table Sequential list and linked list Abstract data structure - data combination and operation set Header node: the first node that does not store data elements First element node: the first node where data elements are stored 1, Definition of linear table A finite sequence of zero or more data elements There is order between elem ...

Added by novicephp on Mon, 07 Feb 2022 07:15:36 +0200

Fair Share (construction + Euler loop)

E. Fair Share [Link](Problem - E - Codeforces) meaning of the title Here you are m m m arrays and two multiple sets L , R L, R 50. R, i ...

Added by weaselandalf on Mon, 07 Feb 2022 06:21:19 +0200

Shortest path problem idea and template code

Problem classification and introduction n represents the number of points and m represents the number of edges The focus of the investigation of the shortest path problem in the algorithm problem is not to prove the correctness of the algorithm, and the principle requirements of the algorithm are not high. The focus of the investigation is ho ...

Added by vinnier on Mon, 07 Feb 2022 05:43:45 +0200

Summary of leetcode's simulated problem brushing 2

Summary of leetcode's simulated problem brushing 2 1-remodeling matrix Title Link: Title Link stamp here!!! Idea: simulate the matrix remodeling process. If the number of elements of the original matrix and the remodeling matrix is different, the remodeling cannot be completed. On the contrary, the remodeling can be completed. First convert t ...

Added by coreyp_1 on Mon, 07 Feb 2022 04:32:27 +0200

Ant colony algorithm to solve 0-1 knapsack problem

Experimental report on 0-1 knapsack problem realized by ant colony algorithm [experiment content] The 0-1 knapsack problem is solved by ant colony algorithm. [experimental environment] Microsoft Visual C++ 6.0 [basic theory] Ant colony algorithm is a bionic algorithm based on the simulation of the foraging and path finding methods o ...

Added by vbcoach on Mon, 07 Feb 2022 04:22:28 +0200

Interval DP Luogu classic questions P1775 P1880 P2858 P1063

Algorithm design of dynamic programming 1: Find out the properties of the optimal solution and describe its structural characteristics 2: Define the optimal value recursively 3: Calculate the optimal value in a bottom-up manner 4: The optimal solution is constructed according to the information obtained when calculating the optimal value ...

Added by ChetUbetcha on Mon, 07 Feb 2022 04:15:15 +0200

Machine learning algorithm series - non linear support vector machine

Background knowledge required for reading this article: linear support vector machine and yidui programming knowledge1, Introduction   previously, we introduced two support vector machine models in two sections - hard interval support vector machine and soft interval support vector machine. These two models can be collectively referre ...

Added by mac007 on Mon, 07 Feb 2022 04:10:15 +0200

66. Preparing for the Blue Bridge Cup - the 13th Simulation Competition (Java group)

Blue Bridge Cup: national software and information technology professionals competition [1] is a national IT discipline competition organized by the talent exchange center of the Ministry of industry and information technology. More than 1200 colleges and universities across the country, including Peking University, Tsinghua University and Shan ...

Added by robtbs on Mon, 07 Feb 2022 03:42:45 +0200