Sorting of data structures
Implementation and idea of common sorting algorithms
Insert sort
Direct insertion
basic thought Direct insertion sort is a simple insertion sort method. Its basic idea is: Insert the records to be sorted into an ordered sequence one by one according to the size of their key values, until all records are inserted, and a new ordered sequ ...
Posted by aloysiusf on Mon, 13 Sep 2021 19:44:24 -0700
Collection of Java foundations
1. Overview of the collection
1.1 related concepts
Sets and arrays are structures that store multiple data, referred to as java containers for short (Note: storage at this time mainly refers to memory storage and does not involve persistent storage, such as databases and txt files)Advantages of arrays in storing multiple data structures
...
Posted by taurus5_6 on Mon, 13 Sep 2021 11:51:30 -0700
2021.09.11 CF1547G How Many Paths & Luogu P5546
CF1547G
How
Many
Paths
\c ...
Posted by bradleybebad on Sat, 11 Sep 2021 17:46:05 -0700
Custom data type
Structure (struct)
Definition of structure variables
#include<stdio.h>
#include<string.h>
#include<ctype.h>
struct MyStruct
{
char name[20];
int age;
}s4,s5,s6;//Create a global list of structure variables
//Create structure global variable
struct MyStruct s3;
//Anonymous structure
struct {
int st;
}st;//Anonymous stru ...
Posted by public-image on Sat, 11 Sep 2021 17:40:48 -0700
The third question of Huawei's recent written test (9.8)
I didn't take part in these computer-based exams. I was interested in doing it. Interested students can refer to it Question 3 (300 points) minimum compilation time Title Description: Company A needs to introduce an open source project into the project and evaluate the compilation time of A module in the open source project. At present, the com ...
Posted by blurredvision on Fri, 10 Sep 2021 12:48:26 -0700
Data structure - minimum spanning tree QuickPass Guide
Data structure - minimum spanning tree QuickPass Guide
1. Introduction to spanning tree and minimum spanning tree
An important difference between a tree and a graph is that there is no loop in the tree, and a spanning tree is to remove the loop by removing some edges from the part that constitutes the loop in the graph. The resulting tree ...
Posted by billspeg on Thu, 09 Sep 2021 23:16:47 -0700
Simple simulation list container
I'm a little white. I'm here to share some daily programming with you. I hope the big guys will support me a lot!!! ❤️❤️❤️
container
Containers: used to manage a collection of objects of a certain type. Various data structures, such as vector, list, deque, set and map, are used to store data. From the implementation point of view, STL c ...
Posted by chaiwei on Thu, 09 Sep 2021 12:21:34 -0700
C language for multi-layer dynamic memory allocation, two-dimensional array
One-dimensional Array Dynamic Memory Allocation
First, let's start with a simple dynamic memory allocation.
#include "stdio.h"
#include "stdlib.h"
#define N 5
int main() {
int* arr = (int*)malloc(sizeof(int)*N);
for(int i = 0; i < N; i++) {
arr[i] = i * i;
}
for(int i = 0; i < N; i++) {
printf("\n% ...
Posted by Daniel Exe on Thu, 09 Sep 2021 10:14:12 -0700
ArrayList Source Details
1.Introduction to ArrayList
At the bottom of the ArrayList is an array queue, which is equivalent to a dynamic array. Its capacity can grow dynamically compared to arrays in Java. Applications can use the ensure Capacity operation to increase the capacity of ArrayList instances before adding a large number of elements. This can reduce the numb ...
Posted by cyber_ghost on Wed, 08 Sep 2021 09:04:13 -0700
[C language] stack and queue
The code in this paper is basically implemented by C language, except for the code implementation of "2.3.4 Leetcode496".
1. Queue
1.1 nature of queue
FIFO: first in, first out. The team goes out first and the team goes out at the end.
1.2 general queue
1.2.1 code implementation of ordinary queue
#include <stdio.h>
#includ ...
Posted by logicsound on Wed, 08 Sep 2021 01:45:14 -0700