Front end learning data structures and algorithms quick start series - sets, dictionaries, and hash tables
Sets, dictionaries, and hash tables
aggregate
Collection: consists of an unordered and unique set of items.
Tip: aggregate It is a concept in mathematics, but it is applied in the data structure of computer science.
Create collection class
Generally, the collection has the following methods:
add(element): adds a new element to the collection
d ...
Posted by Savahn on Mon, 22 Nov 2021 18:15:07 -0800
Prim algorithm solves the minimum spanning tree (solves the road repair problem)
1, What is Prim algorithm
The process of finding the minimum spanning tree by prim algorithm adopts the idea of greedy algorithm. For a connected network with N vertices, PRIM algorithm finds an edge with the smallest weight from the connected network every time. This operation is repeated N-1 times. The spanning tr ...
Posted by Hafkas on Mon, 22 Nov 2021 15:48:24 -0800
Data structure diagram storage structure 2
Don't read the big talk data structure book clearly.
The graph structure is complex, and there may be a connection between any two vertices. Therefore, the relationship between elements cannot be represented by the physical position of data elements in memory, that is, the graph cannot be represented by a simple sequential storage structure. A ...
Posted by Uranium-235 on Mon, 22 Nov 2021 09:14:46 -0800
Priority queue
1. Priority queue
1.1 concept
Queue is a first in first out data structure, but in some cases, the data operated may have priority. Generally, when leaving the queue, elements with high priority may be required to leave the queue. In this scenario, it is obviously inappropriate to use the queue. For example, when playing games on the mobi ...
Posted by killsite on Mon, 22 Nov 2021 07:27:01 -0800
[operating system experiment] simulation using dynamic partition allocation (implemented in c + +)
Experimental purpose
Understand the data structure and allocation algorithm used in dynamic partition allocation, and further deepen the understanding of dynamic partition storage management and its implementation process.
Experimental content
(1) The dynamic partition allocation process alloc() and the recovery process free() using the ...
Posted by cpjok on Mon, 22 Nov 2021 01:25:01 -0800
Step on the pit when using recursion - be sure to give the end condition
preface
When I first learned programming in freshman year, I had a preliminary contact with the concept of recursion. At that time, I also used it to complete several homework problems such as factoring and fiboracci sequence, but I found that up to now, I have been taking the course of data structure and algorithm, and I still have a vague un ...
Posted by Michdd on Sun, 21 Nov 2021 19:09:36 -0800
29 time and date class - cnblog
1. Time and date
1.1 Date class (application)
Overview of Date class Date represents a specific time, accurate to milliseconds Date class constructor
Method nameexplainpublic Date()Allocate a Date object and initialize it so that it represents the time it is allocated, accurate to millisecondspublic Date(long date)Allocates a Date object ...
Posted by glueater on Sun, 21 Nov 2021 18:58:57 -0800
Morris, recursive binary tree before, during and after traversal
Experiment time: 11.10
catalogue
Generating complete binary tree
Implementation of Morris algorithm
Introduction to morris traversal
Implementation principle of morris traversal
The essence of morris traversal
Briefly describe the algorithm process
Recursive implementation
Experimental results (including time, space and output results) ...
Posted by defeated on Sun, 21 Nov 2021 13:58:54 -0800
Recursive model summary II - merge sort
1. Preface
For beginners of recursion, recursion is undoubtedly difficult to understand. This series aims to analyze the recursion used in common algorithms to a certain extent, and summarize its recursion model while learning these algorithms. In order to deepen the understanding of recursion, at the same time, when we master a variety of ...
Posted by niki on Sun, 21 Nov 2021 12:33:37 -0800
Data structure_ Thoroughly understand the tree notes
1, Definition of tree
A finite set composed of n (n > 0) nodes is an empty tree when n is equal to zero For any non empty tree, it has the following properties: 1. There is a special node in the tree that becomes the root, which is represented by r 2. Other nodes can be divided into m (M > 0) disjoint finite sets T1.T2.T3... Tm, in w ...
Posted by sitorush on Sun, 21 Nov 2021 11:24:57 -0800