Classic sorting algorithm

Several common sorting algorithms are listed here: 1. Selective sorting, 2. Bubble sorting, 3. Insert sorting, 4. Merge sorting, 5. Quick sorting, 6. Heap sorting, 7. Count sorting, 8. Cardinal sorting. Catalog 1. Select Sort 2. Bubble sorting 3. Insert Sort 4. Merge Sort 5. Quick Sort 6. Heap Sorting 7. Count Sort O(N) 8. Cardinal Sor ...

Posted by slak on Thu, 25 Aug 2022 02:29:44 +0300

Data structure - sorting

Data structure note Directory: 1. Introduction and time complexity 2. Linear meter 3. Trees 4. Fig 5. Find 6. Sorting 6.1 basic concepts 6.1.1 objectives Order keywords 6.1.2 classification Internal sort Data elements are all in memory during sorting External sort During the sorting process, data is constantly moving bet ...

Posted by bibie on Sun, 21 Aug 2022 09:50:12 +0300

2022 Hangzhou Electric Power Multi-School 9 (Summary + Supplement)

summary Today, this multi-school should be the best one to hit this summer vacation (although the ranking is not very high). My starting teammate found that the tree dp was signed in for question 1009. I thought about guessing an even-numbered side. I stared at my teammate and wrote A for ten minutes. Then we went to see 1003 again. After my t ...

Posted by thomasgrant on Thu, 18 Aug 2022 22:30:52 +0300

[dynamic programming] monotonic queue optimization DP

Monotonic queue optimization DP Maximum subsequence sum Source: https://www.acwing.com/problem/content/137/ Title Description Enter a length of n n An integer sequence of n, from which a length of no more than m ...

Posted by FlashbackJon on Sun, 07 Aug 2022 21:36:46 +0300

[algorithm collection] the second day of learning algorithms (dichotomy and sorting)

✅🎡 Personal homepage: Program ape chase ✅🎡 Series column: Algorithm set ✅🎡 Current status: create Java learning road (zero foundation to employment practice) series, which is currently updated to JAVAWEB development ✅🎡 About the author: Hello, everyone. I'm a program ape chaser, a new star creator in the whole stack field, an ...

Posted by grandman on Wed, 03 Aug 2022 22:19:23 +0300

Programming problems related to C++ Dijkstra algorithm

#include<iostream> using namespace std; #define N 10000 #define Linit 11 void Dijstra(int edges[][Linit], int origin, int* dist, int* path); int main() { char str[200] = {'1','-','4',',','1','-','6',',','2','-','4',',','2','-','6',',','3','-','5',',','3','-','6',',','4','-','5',',','5','-','6'}; int origin = 1; int target = 3; in ...

Posted by dirkbonenkamp on Sat, 02 Jul 2022 21:45:03 +0300

c language implementation of queue

Sequential implementation of queues typedef struct{ int data[MaxSize]; int front,rear; } SqQueue; For the initialization of the sequence queue, front points to the queue head element, and rear points to the next position of the queue tail element, that is, the next position that should be inserted. void Init(SqQueue q){ q.front=0 ...

Posted by natbrazil on Fri, 01 Jul 2022 21:46:43 +0300

[algorithm] the course schedule is not simple -- topological sorting

  introduction   >_< Now we need to arrange a timetable for the students (the learning order of the course) But it's not that simple:   curriculum Precursor course Course 0 Course 1 Course 0, course 4 Course 2 Course 3 Course 0 Course 4 Course 5 Course 3 Course 6 Course 3   Might as well draw a Graph and try i ...

Posted by noimad1 on Wed, 25 May 2022 22:41:14 +0300

Heap and heap sorting

Heap and heap sorting Definition of heap The heap is a complete binary tree: except for the last layer, the other layers must be full at several points, and the nodes of the last layer must be filled gradually from left to right The value of each parent node in the heap must be greater than or equal to (or less than or equal to) the value of ...

Posted by activeradio on Wed, 25 May 2022 13:10:30 +0300

[graph coloring problem] detailed optimization

Graph coloring problem [1] Given undirected connected graphs, G and m have different colors. These colors are used to color the vertices of graph G, and each vertex has a color. Is there a shading method that makes the 2 vertices of each edge in G have different colors. [2] If a graph needs at least m colors to make the two vertices connected b ...

Posted by peeps on Wed, 25 May 2022 11:38:54 +0300