Summary of basic algorithm template
preface
๐ฐ Welcome to OpenAll_Zzz's blog, here we work together and make progress together!๐ The content shared in this issue is a little huge - algorithm. It mainly shares the very stable algorithm template, which mainly helps the author review and use.๐ If you have doubts about an algorithm template, please post your questions in th ...
Added by Danaldinho on Sun, 12 Dec 2021 17:51:10 +0200
For a given sequence, realize direct insertion, half insertion, bubbling, hill, fast, selection and heap sorting
1. This code implements a total of 7 common sorts, of which the idea of direct insertion sort and half insertion sort is the same, but the half insertion sort adopts the dichotomy when looking for the insertion position, which is faster than direct insertion sort.
2. Bubble sorting is very simple, but you can go one step further and add a flag ...
Added by shah on Sun, 12 Dec 2021 17:39:02 +0200
Solution to the problem of massive data duplication checking
1. Four ways to deal with massive data problems
Divide and conquer
Basically, the divide and conquer idea can solve the problem of dealing with massive data, but generally it will not be the optimal solution, but it can be used as a baseline, and the sub problem can be gradually optimized to achieve a better solution. The traditional merg ...
Added by Jayson on Sun, 12 Dec 2021 17:03:19 +0200
This article takes you to use a variety of programming paradigms for process encapsulation
preface
Previous examples of adders One article makes it easy for you to master multiple paradigms The packaging differences of various paradigms were explained, and many children's shoes were read. This time, I will continue to explain the differences between these programming paradigms through the encapsulation of processes.
Structural desi ...
Added by Chris_Mc_1985 on Sun, 12 Dec 2021 16:27:23 +0200
Simulation problem of national college computer ability challenge
Simulation problem of national college computer ability challenge
1. Count the number of squares between 1 and N (inclusive) and output this number. Tip: the number of squares. For example, 4 is the square of 2, 16 is the square of 4, and 5 is not the square. Input Description: an integer n (n < 100000); Output Description: number of square ...
Added by viriio on Sun, 12 Dec 2021 07:21:38 +0200
Data structure 1-3 - application example: maximum sub columns and problems (divide and conquer, online processing)
I'll go. I feel amazing after reading this divide and rule, but I don't understand it very well. So when learning this place, I should have a good taste and check the information on the Internet. Here's my understanding: The eight numbers are separated in the middle, the left ones are separated in turn, and the right ones are separat ...
Added by AdamBrill on Sat, 11 Dec 2021 14:34:31 +0200
Circular linked list and Joseph Ring problem
Circular linked list
One. Establishment of linked list The tail node pointer field of the linked list is NULL For the establishment of circular linked list, the tail node refers to the head node
void CreatByRear(LinkList head)
{
Node*r,*s;
char name[20];
int number;
r=head;
printf("Please enter the student's name and student nu ...
Added by somenoise on Sat, 11 Dec 2021 14:10:09 +0200
C language data structure - sequence table
Sequence table:
Creation of sequence table:
Define structure: the structure member contains an integer array and an integer variable that records the last data subscript:
#define DATASIZE 5
typedef struct
{
int data[DATASIZE];
int last;
}sqlist_t;
Write a function to create a sequence table: return the first address of the sequence table ...
Added by Hellomonkey on Sat, 11 Dec 2021 10:05:39 +0200
Data structure Java data structure binary tree
Binary tree
1. Tree structure
1.1 concept
Tree is a nonlinear data structure. It is a set with hierarchical relationship composed of n (n > = 0) finite nodes. It is called a tree because it looks like an upside down tree, that is, it has roots up and leaves down. It has the following characteristics:
There is a special node, called t ...
Added by markjreed on Sat, 11 Dec 2021 05:41:49 +0200
Design an LRU efficiently
prefaceHello, I'm bigsai. I haven't seen you for a long time. I miss you very much!Recently, a little friend complained to me that he didn't meet LRU. He said that he knew that he had been asked about LRU a long time ago, but he thought he wouldn't meet it, so he didn't prepare for it for the time being.Unfortunately, I really got it! His mood ...
Added by lukesb on Thu, 09 Dec 2021 08:35:28 +0200