Java, Android Backpack Problem - Dynamic Planning
Preface
Following the previous backpack problem, Greedy Algorithms, this time let's look at dynamic planning For dynamic planning, it is dynamic planning that comes into direct contact when you first look at the backpack problem Feeling is also simpler
Specific requirements of the topic, see the previous one in detail, this one tells us ...
Posted by lhaynes on Mon, 06 Dec 2021 07:04:06 +0100
Experimental report on data structure personal telephone number query system
Experiment purpose and requirements
Objective: by designing a personal telephone number query system, we can further be familiar with the concept, basic knowledge and skills of some binary trees, and use the basic knowledge and skills to solve simple object-oriented programming problems. Realize fast query according to the information entered b ...
Posted by lancia on Mon, 06 Dec 2021 06:10:47 +0100
Graph definition, graph storage, depth, breadth, first traversal,
Path: a sequence of vertices consisting of contiguous edges
Path length: the sum of the number / weight of edges or arcs on the path
Loop (loop): the first vertex and the last vertex are the same path
Simple path: a path with different vertices except that the start and end points of the path can be the same
Simple loop (simple loop): a pat ...
Posted by 947740 on Mon, 06 Dec 2021 04:37:22 +0100
[Python 100 day learning notes] Day17 data structure and algorithm
Data structures and algorithms
Algorithm: methods and steps to solve problems Evaluate the quality of the algorithm: asymptotic time complexity and asymptotic space complexity. Large O markers for asymptotic time complexity:
-Constant time complexity - bloom filter / hash storage -Logarithmic time complexity - half search (binary search ...
Posted by bb_xpress on Sun, 05 Dec 2021 20:10:30 +0100
Improved supernatural merge sorting algorithm
My original intention is to write a bottom-up merging algorithm, but it is too troublesome to give the head and tail coordinates or length of the subsequence segments of the sorting function every time, and whether the molecular sequence segments are odd or even. So I wonder if I can store the head and tail coordinates of each subsequence segme ...
Posted by guido88 on Sun, 05 Dec 2021 12:31:16 +0100
leetcode this week
1. Find the 3-bit even number Give you an integer array digits, where each element is a number (0 - 9). There may be duplicate elements in the array. You need to find all integers that meet the following conditions and are different from each other: The integer consists of three elements in digits connected in any order. The integer does not co ...
Posted by andrewholway on Sun, 05 Dec 2021 09:49:05 +0100
LeetCode brush notes double pointer sliding window
sliding window
Sliding window: if two pointers point to the same linear table, the traversal direction is the same, and the starting points of the two pointers are different, a sliding window will be formed. The two pointers move with different strategies until the values of the two pointers are equal or meet other special conditions.
76 mini ...
Posted by yoda69 on Sun, 05 Dec 2021 06:37:06 +0100
Introduction to generics, wrapper classes and ArrayList in Java
1, Generics
1.1 definition of generic class
// 1. Angle brackets < > are signs of generics
// 2. E is a type variable, and the variable name should generally be capitalized
// 3. E is a formal parameter when defined, which means the type finally passed in by MyArrayList, but it is not known yet
public class MyArrayList<E> { ...
Posted by acac on Sun, 05 Dec 2021 05:21:54 +0100
Codeforces 1548E Gregor and the Two Painters
Title Link
Codeforces 1548E Gregor and the Two Painters
General idea of the topic
There are two sequences \ (\ {a \} \) and \ (\ {B \} \) with lengths of \ (n \) and \ (m \) respectively, so as to construct the grid of \ (n\times m \). The weight at \ ((i,j) \) is \ (a_i+b_j \), which is called grid \ ((i,j) \) is bad if the weight of grid \ (\ ...
Posted by Yaak on Sat, 04 Dec 2021 22:57:40 +0100
< data structure > KMP algorithm
next array
definition
Strict definition: next[i] means the maximum K of the substring s[0...k] == s[i-k...i] (the prefix and suffix can overlap, but not s[0..i]
Meaning: the subscript of the Prefix suffix such as the longest appearance. If not, it is given - 1
Graphical explanation: s[0] starts to find a longest substring, which satisfies a co ...
Posted by galvin on Sat, 04 Dec 2021 04:56:43 +0100