Cardinality sort - radius sort

Cardinality sort Introduction to cardinality sorting (bucket sorting): radix sort belongs to "distribution sort", also known as "bucket sort" or bin sort. As the name suggests, it allocates the elements to be sorted to some "buckets" through the values of each bit of the key valueThe cardinal ranking method is ...

Posted by SundayDriver on Mon, 28 Feb 2022 00:06:20 +0100

Shortest path algorithm

1.Dijkstra algorithm 1.1 algorithm flow interpretation 1. Initialization: The shortest path length of the starting point is set to zero, and the shortest path length of the other points is set to positive infinity. 2.n wheel slack: Dij algorithm divides the points into the set of points with the shortest path and the set of points without ...

Posted by dk1983 on Sun, 27 Feb 2022 14:19:09 +0100

Data structure - queue

Characteristics of queue First in first out (FIFO) Queue is called queue because of its characteristics. It's very similar to the queue in the supermarket, isn't it? The front keeps walking and the back keeps up In the queue, you can only insert at the back and delete at the front. The insert operation is also called enqueue, and the delete ...

Posted by skeener on Sun, 27 Feb 2022 13:19:52 +0100

Daily leetcode - 142 Circular linked list II

subjectGiven the head node of a linked list, it returns the first node from the linked list into the ring. If the linked list is acyclic, null is returned.If there is a node in the linked list that can be reached again by continuously tracking the next pointer, there is a ring in the linked list. In order to represent the links in a given linke ...

Posted by The End on Sun, 27 Feb 2022 11:42:29 +0100

2022 winter vacation algorithm summary

1, Introduction to algorithm 1. Simple version 2022-1-11 704. Binary search Topics and examples Given an n-element ordered (ascending) integer array nums and a target value target, write a function to search the target in nums. If the target value exists, return the subscript, otherwise return - 1. Example 1: Input: num = [- 1,0,3,5,9,12], ...

Posted by vapour_ on Sun, 27 Feb 2022 11:38:53 +0100

Chapter 3 linear table

Chapter 3 linear table Definition of linear table Linear List: a finite sequence of zero or more data elements. Emphasis: first, it is a sequence. Then emphasize that the linear table is limited. (direct) precursor element, (direct) successor element. The number of linear table elements n(n ≥ 0) is defined as the length of the linear ta ...

Posted by razorsedgeuk on Sun, 27 Feb 2022 09:48:46 +0100

Section 7 of C + + after the initial stage - polymorphism

Our task in this section is to find out the polymorphism catalogue 1, Concept of polymorphism 2, Override (overwrite) of virtual function: 3, override and final in C++11 Keyword override: Keyword: final Comparison: overload, overwrite (override), hide (redefine) 4, Abstract class concept Interface inheritance and implementation inhe ...

Posted by futurshox on Sun, 27 Feb 2022 04:05:10 +0100

[daily algorithm] force deduction 350 Intersection of two arrays II

describe Given two arrays, write a function to calculate their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output:[2,2] Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output:[4,9] explain: The number of occurrences of each element in the output result shall be consistent with the minimum number of occurrence ...

Posted by phpete2 on Sun, 27 Feb 2022 02:04:52 +0100

Short link generation

Project address https://github.com/TheLandscapeBe/tinyurl.git Project address Short connection generation service What is short connection generation? Short connection generation is to convert the ordinary web address into a relatively new address. For example: a long link address: https://developer.aliyun.com/article/829833?spm=a2c6h.13148 ...

Posted by jgh84 on Sat, 26 Feb 2022 19:42:35 +0100

Algorithm question brushing record (DAY5)

Who's in the Middle(poj2388) Original question link Method 1: Wrong solution: use set, but ignore that there are no duplicate elements in set!!! The error code is as follows: #include<iostream> #include<set> using namespace std; #define NMAX 10004 set<int> cow; int N; int main() { cin >> N; for (int i = 0;i < N;i+ ...

Posted by tharagleb on Sat, 26 Feb 2022 13:45:30 +0100