Time complexity
catalogue
1, Concept definition
2, Symbolic representation
3, Common species
4, Parsing example
1, Concept definition
According to the definition, time complexity refers to the time required for the algorithm to run when the input data size is N +. Note:
It counts the "number of calculation operations" of the algorithm, no ...
Posted by hamza on Thu, 17 Feb 2022 22:55:04 +0100
Maximum product (DP + high precision)
Title Link https://www.luogu.com.cn/problem/P1018
This year is the "2000 - world year of mathematics" determined by the International Mathematical Union, and coincides with the 90th anniversary of the birth of Mr. Hua Luogeng, a famous mathematician in China. In Jintan, Jiangsu, Mr. Hua Luogeng's hometown, a new mathematical intellig ...
Posted by Hiro on Thu, 17 Feb 2022 21:25:04 +0100
[data structure] Java implementation of eight sorting algorithms
methodaverage timeWorst timeExtra spacestabilityBubble sortingO(n2)O(n2)O(1)stableSelect sortO(n2)O(n2)O(1)instableInsert sortO(n2)O(n2)O(1)stableCardinality sortO(d(n+r))O(d(n+r))O(d+r)stableShell Sort O(nlogn)O(n2)O(1)instableQuick sortO(nlogn)O(n2)O(nlogn)instableMerge sortO(nlogn)O(nlogn)O(1)stableHeap sortO(nlogn)O(nlogn)O(1)instable
1. In ...
Posted by souravsasi123 on Thu, 17 Feb 2022 18:28:20 +0100
Recursive maze eight queens
recursion
Basic concepts
Recursion means that the method calls itself, and different variables are passed in each call. Recursion helps solve more complex problems than that, while making the code simpler
Call mechanism
Analysis of printing problems:
Recursive call rule:
When the program executes a method, it will open up an independ ...
Posted by laurton on Thu, 17 Feb 2022 18:23:30 +0100
Divide and conquer -- chessboard coverage (JAVA)
Problem Description:
In a chessboard composed of 2^k * 2^k squares, just one square is different from other squares. This square is called a special square, and the chessboard with a special square is called a special chessboard. When k ^ 4 is in different positions on the chessboard, there will be a special case, for example, when k ^ 4 is in ...
Posted by gte806e on Thu, 17 Feb 2022 16:19:46 +0100
[unofficial solution] 2022 Niuke winter vacation algorithm basic training camp 5
2022 Niuke winter vacation algorithm basic training camp 5_ACM/NOI/CSP/CCPC/ICPC algorithm programming high difficulty practice competition_ Ox guest competition OJ
catalogue
A-vaccine children
B-ping Pong children
C-chess kid
D-digital children
E-resuscitation child
F-flying child
G-163 children
H-163 children
I-bunny child
J-childr ...
Posted by hothientuan on Thu, 17 Feb 2022 14:03:24 +0100
The third reason for the second kill algorithm interview question -- Analysis of the 240 phase of the weekly match of force deduction
Competition address: https://leetcode-cn.com/contest/weekly-contest-240
First of all, I wish you a happy mother's Day! Let's look at the question
Question 1
subject
Enter a two-dimensional integer array logs, where
l
o
g
...
Posted by powah on Thu, 17 Feb 2022 11:58:19 +0100
Sort | quick sort
thought
For each division, make the left side smaller than the benchmark and the right side larger than the benchmark, but in disorder, and then divide the left and right sides once again. In this way, the division will continue until the size of the decomposed array is 1 and the division stops. At this time, it is in order
Partition function ...
Posted by varecha on Thu, 17 Feb 2022 10:19:44 +0100
Luogu P1926 little schoolboy - question brushing Army
P1926. Little schoolboy - question brushing Army
subject
Topic background
Mathematics is fire, lighting up the lamp of physics; Physics is a lamp, illuminating the way of chemistry; Chemistry is the road leading to the pit of biology; A creature is a pit, burying a man of reason. Classical Chinese is fire, lighting up the palace lamp of hist ...
Posted by eddiegster on Thu, 17 Feb 2022 08:48:27 +0100
Leetcode notes -- modification and construction of binary tree in binary tree chapter
Catalogue of series articles
I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...
Posted by crimaniak on Thu, 17 Feb 2022 05:15:27 +0100