Day_08 array sorting algorithm

Array sorting algorithm Algorithm = data structure + program code 1. Sorting: Suppose that the sequence containing n records is {R1, R2,... Rn}, and the corresponding keyword sequence is {K1, K2,..., Kn}. Reorder these records to {Ri1,Ri2,... Rin}, so that the corresponding keyword values meet the requirements of Ki1 < = ki2 < =... < ...

Posted by SilentQ-noob- on Tue, 02 Nov 2021 06:46:36 -0700

Top ten sorting algorithms

Bubble sort algorithm Bubble sorting repeatedly traverses the sequence to be sorted, comparing two adjacent elements each time, and exchanging them if their order is wrong. Repeat the traversal until there is no need to exchange, indicating that the sequence has been sorted. Algorithm steps: Compare adjacent elements: if the first is la ...

Posted by hendoyeah on Tue, 02 Nov 2021 00:30:03 -0700

Data structure and algorithm III [single linked list]

1. Linked list The construction of sequence table needs to know the data size in advance to apply for continuous storage space, and the data needs to be relocated during expansion, so it is not very flexible to use. Linked list structure can make full use of computer memory space and realize flexible dynamic memory management. 1.1 definit ...

Posted by arkleyjoe on Mon, 01 Nov 2021 10:34:40 -0700

Brush notes: binary tree

101. Symmetric binary tree To judge whether the mirror image is symmetrical, make a dotted line in the middle to judge whether the half fold coincides. For example, the root node depends on whether its left child node and right child node are the same, and then the left child node of the left child node and the right child node of the right c ...

Posted by Jayson on Mon, 01 Nov 2021 06:37:28 -0700

Data structure ---- binary tree

1. Tree structure 1.1 definitions Tree is a nonlinear data structure, which is composed of n( n โ‰ฅ 0 n\geq0 n โ‰ฅ 0) finite nodes form a set with hierarchical relationship. It is called a tree because it looks li ...

Posted by REDFOXES06 on Sun, 31 Oct 2021 20:46:11 -0700

java data structure - diagram - continuous supplement

On the right side of the page, there is a directory index, which can jump to the content you want to see according to the titleIf not on the right, look for the left Main article: https://blog.csdn.net/grd_java/article/details/120526149 Why is there a map Linear table and tree, linear table is limited to a direct precursor and a direct suc ...

Posted by designsubway on Sun, 31 Oct 2021 20:29:17 -0700

Look at animation algorithms: two-way queue dequeue

brief introductiondequeue refers to a two-way queue, which can insert and obtain data from the head of the queue or from the tail of the queue.This article will introduce how to create dequeue and some basic operations of dequeue.Implementation of bidirectional queueLike ordinary queue items, bidirectional queues can be inserted and deleted at ...

Posted by ch1326 on Sun, 31 Oct 2021 18:31:15 -0700

Swordfinger offer|| Special assault 40-day brush plan (days 1-20)

Title address: https://leetcode-cn.com/study-plan/lcof/?progress=xcewnbs summary When looking for the middle node of the chain table, use the fast and slow pointers, when both the fast and slow pointers are initially pointing to the head, the end condition cannot be while(fast!=null&&fast.next!=null) Because of this, if I judge ...

Posted by kusal on Sun, 31 Oct 2021 14:09:29 -0700

Data structure and algorithm I [basic concepts]

1. Concept of algorithm Algorithm is the essence of computer processing information, because computer program is essentially an algorithm to tell the computer the exact steps to perform a specified task. Generally, when the algorithm is processing information, it will read the data from the input device or the storage address of the data, ...

Posted by messer on Sun, 31 Oct 2021 12:05:03 -0700

[collection does not get lost] search and fundamentals of graph theory

catalogue ๐ŸŒ DFS ๐ŸŒ BFS ๐ŸŒ  Breadth first traversal of trees and graphs โ†’ topological sorting Example: ๐ŸŒ  shortest path ย  ๐Ÿ‘‰ Single source shortest path (naive Dijkstra) (there must be no negative weight edge) โ†’ heap optimization Dijkstra (to be continued...) ๐Ÿ‘‰ Single source shortest path with negative weight edge (Bellm ...

Posted by stringfield on Sun, 31 Oct 2021 10:03:57 -0700