MindMap Gallery Data Structures and Algorithms
Common basic computer knowledge 1.1 Notes on data structures and algorithms, including basic concepts of data structures, linear tables and their sequential storage structures, stacks and queues, linear linked lists, trees and binary trees, etc.
Edited at 2021-07-17 23:56:33One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
Common basic knowledge (1.1)
Data Structures and Algorithms
what is algorithm
Algorithms and their basic characteristics
An algorithm is an accurate and complete description of a solution to a problem
Basic Features
feasibility
The steps can be implemented; the execution results achieve the expected goals
certainty
The steps are clear, no ambiguity, no ambiguity allowed
Finiteness
Limited time to complete
have enough information
Algorithms may be ineffective when insufficient intelligence is provided
Algorithmic complexity
definition
It is used to measure the advantages and disadvantages of the algorithm, including the time complexity of the algorithm and the space complexity of the algorithm.
The time complexity of the algorithm
The computational effort required to execute the algorithm
Note: The time complexity of the algorithm ≠ the specific execution time of the algorithm program
It can be understood that the time complexity of the algorithm is understood as the planning time
Algorithm space complexity
definition
refers to the memory space required to execute this algorithm
storage
Storage space occupied by input data
The storage space occupied by the program itself
Additional space required during algorithm execution
Unit of work during algorithm execution
Additional storage space required for a certain data structure
Note: If the amount of extra space does not change with the size of the problem, the algorithm is said to work in place.
Reduce the space complexity of the algorithm
Mainly should reduce the storage space and additional space occupied by input data
Compression storage technology is usually used
Basic concepts of data structures
What is data structure
definition
Refers to a collection of related data elements (it contains data and structure)
logical structure of data
Refers to the data structure that reflects the logical relationship between data elements (i.e., the relationship between before and after)
Data storage structure (physical structure of data)
It is the way in which the logical structure of data is stored in computer storage space.
Representation of data structure
mathematical formal definition of the logical structure of data
The data structure is a tuple
D=(D,R)
B represents data structure
D is the set of data elements
R is a set of relationships on D, which reflects the context and context relationships between data in D.
Example 1: Treat three meals a day as a data structure Then B=(D,R) D={breakfast, lunch, dinner} R={(breakfast, lunch), (lunch, dinner)}
Graphical representation
example 1:
breakfast
data node (node)
Lunch
dinner
root node
Node in data structure without antecedent
Terminal node (leaf node)
Nodes in the data structure that have no aftermath
internal node
Nodes in the data structure other than the root node and terminal node
Linear data structures and non-linear data structures
Classification based on the complexity of the relationship between each data element in the data structure
linear structure
a non-empty data structure
There is only one root node
Each node has at most one antecedent and at most one consequent.
nonlinear structure
The conditions for linear structure are not met
tree structure
grid
Linear table and its sequential storage structure
Basic concepts of linear tables
Among data structures, linear structures are called linear tables. Linear tables are the simplest and most commonly used data structures.
Data elements in the same linear table must have the same characteristics, that is, they belong to the same data object
Example: array, matrix, vector
Structural characteristics of non-empty linear tables
There is only one root node
Each node has at most one antecedent and at most one consequent.
Sequential storage structure of linear table
sequential storage structure
Store elements in a linear list one after another in an adjacent storage space
Sequence table features
The storage space occupied by all elements in a linear table is continuous
Each data element in the linear table is stored in logical order in the storage space.
linked storage structure
stacks and queues
Stack and its basic operations
definition
The stack is a special linear list in which all insertions and deletions are limited to the same end of the list. The end that allows insertion and deletion is called the top of the stack, and the end that does not allow deletion and insertion is called the bottom of the stack. When there are no elements in the stack, it is called an empty stack.
Stack modification principles
"Last in first out" or "first in first out"
Basic operations of stack
push to stack
Exit
Read the top element of the stack
Queues and their basic operations
definition
Refers to a linear list that allows insertion at one end (the tail of the queue) and deletion at the other end (the head of the queue or the head of the queue)
Team modification principles
"First in, first out" or "Last in, last out"
Loop list and its operations
definition
Wrap the last position of the queue storage space to the first position, A logical circular space is formed, which can be used circularly by the same queue.
Note: The initial state of the circular queue is empty, that is, front=rear=m
linear linked list
Basic concepts of linear linked lists
Refers to the linked storage structure of a linear list, referred to as a linked list. This type of linked list has only one pointer field per node, also known as a singly linked list.
chained stack
chained queue
Comparison of sequence list and linked list
circular linked list
Trees and Binary Trees
Basic concepts of trees
A tree is a simple non-linear structure
Note: The number of nodes in a tree is equal to the sum of the degrees of all nodes in the tree plus 1
Binary tree and its basic properties
Characteristics of binary trees
Properties of binary trees
Full binary tree and complete binary tree
Binary tree storage structure
Binary tree traversal
The principle of first left and then right
Refers to visiting all nodes in the binary tree without repeating
Preorder traversal
A B D G E H C F I
inorder traversal
G D B E H A C F I
Postorder traversal
G D E H B I F C A
Find technology
sequential search
Starting from the first element of the linear list, compare the elements in the linear list with the element being checked one by one.
Applies only to sequence tables
A linear list is an unordered list
The linear table is an ordered list and uses a chain storage structure.
binary search
To meet the conditions
sequential storage structure
A linear list is an ordered list (elements are arranged in non-decreasing order)
For an ordered line list of length n, compare the lookup element
sorting techniques
definition
Refers to organizing an unordered sequence into an ordered sequence arranged in a non-decreasing sequence of values.
commutative sorting
bubble sort
Quick sort
Insertion class sorting
simple insertion sort
Hill sort
Select class sorting method
simple selection sorting method
heapsort