Python data structure and algorithm -- basic data structure

Basic data structure 1. Linear structure Definition of linear structure: linear structure is a set of ordered data items, in which each data item has a unique precursor and successor Except for the first one, there is no precursor, and the last one has no successor When a new data item is added to the data set, it will only be added to t ...

Added by kmaid on Mon, 18 Oct 2021 09:09:57 +0300

[sword finger Offer] sort

Self-Improvement Money is not life's report card. Money cannot be used to measure whether life is wonderful or not. Common algorithms The following figure shows the sorting process of common sorting algorithms under the four types of input data of "random disorder", "near order", "complete reverse order&quot ...

Added by Aikon on Mon, 18 Oct 2021 06:02:24 +0300

(C language) single linked list experiment

1. (1): write a program to establish a single linked list and output all data elements in the single linked list one by one. Implementation code: #include <stdio.h> #include <stdlib.h> typedef struct node{ int data; struct node *next; }linklist; linklist *CreateLinklist(){ linklist *head,*p,*s; head = (linklist *)malloc(si ...

Added by iovidiu on Sat, 16 Oct 2021 02:22:59 +0300

leetcode [array medium] 209. Subarray with the smallest length

preface Hello, I'm long Lu. I'm just a junior now. I'm working on the back end and occasionally on the front end. Now the main language is Java. For a long time before, I was learning some technologies of web development. I haven't studied and brushed questions like data structures and algorithms for a long time. I plan to pick them up and ...

Added by bugsuperstar37 on Fri, 15 Oct 2021 20:53:30 +0300

Data structure - sequential stack and chain stack

Stack is a common data structure and a linear table with limited operation. Limit linear tables to insert and delete only at the end of the table. This end is called the top of the stack and the other end is called the bottom of the stack. Inserting a new element into a stack is also called stack entry, stack entry or stack pressing. It puts th ...

Added by igorek on Fri, 15 Oct 2021 06:12:31 +0300

Abstractqueuedsynchronizer (AQS) for Java Concurrent Programming

Abstractqueuedsynchronizer (AQS): The JDK concurrency package (package name: java.util.concurrent, hereinafter referred to as JUC) provides many tool classes for concurrent operations, such as ReentrantLock, CountDownLatch, etc. The foundation of these concurrency utility classes is abstractqueuedsynchronizer *AQS maintains a shared resource ...

Added by dr_freak on Fri, 15 Oct 2021 01:23:24 +0300

[initial level of data structure] i. time complexity and space complexity

1, Algorithm efficiency When we solve problems, there may be a variety of algorithms that are feasible. Which algorithm should we choose? Which algorithm is better? In fact, to measure the quality of an algorithm, we look at the execution efficiency of the algorithm. After the algorithm is written into an executable program, it needs time ...

Added by flipis on Fri, 15 Oct 2021 00:24:16 +0300

js algorithm and data structure -- two-way linked list 2

Get implementation – get the corresponding location element The idea is the same as that of the single linked list! code // 7 get method -- it is not efficient. It can be divided equally. After all, there is a tail node! DoublyLinkedList.prototype.get = function(position){ if(position < 0 || position >= this.length) return ...

Added by trdesigns on Thu, 14 Oct 2021 07:42:09 +0300

Algorithm efficiency and elementary sorting

Reference from: Algorithm column catalogue 1, Time complexity 1. Algorithm efficiency 2. Time complexity   3. Comparison of time complexity 2, Elementary sorting 1. Insert sort 2. Hill sort 3. Bubble sorting 4. Quick sort 5. Merge and sort 6. Select sort 7. Heap sorting 8. Count sorting 9. Bucket sorting 10. Cardinality sor ...

Added by YorkshireSteve on Tue, 12 Oct 2021 21:54:53 +0300

STM32 program architecture kernel porting

catalogue 1, Why use program architecture 2, Transplantation practice 3, Explanation of system execution process 4, Explanation of queue algorithm 1, Why use program architecture 1. Improve the stability of the program and avoid code conflict. 2. Solve common pain points in product development. For example, short press, short pre ...

Added by Aretai on Tue, 12 Oct 2021 04:49:05 +0300