This commit is contained in:
krahets
2024-04-06 03:02:20 +08:00
parent 0a9daa8b9f
commit 8d37c215c8
148 changed files with 70398 additions and 408 deletions
+5 -5
View File
@@ -2,9 +2,9 @@
comments: true
---
# 1.2   What is an Algorithm
# 1.2   What is an algorithm
## 1.2.1   Definition of an Algorithm
## 1.2.1   Definition of an algorithm
An "algorithm" is a set of instructions or steps to solve a specific problem within a finite amount of time. It has the following characteristics:
@@ -12,7 +12,7 @@ An "algorithm" is a set of instructions or steps to solve a specific problem wit
- The algorithm is feasible, meaning it can be completed within a finite number of steps, time, and memory space.
- Each step has a definitive meaning. The output is consistently the same under the same inputs and conditions.
## 1.2.2   Definition of a Data Structure
## 1.2.2   Definition of a data structure
A "data structure" is a way of organizing and storing data in a computer, with the following design goals:
@@ -25,7 +25,7 @@ A "data structure" is a way of organizing and storing data in a computer, with t
- Compared to arrays, linked lists offer more convenience in data addition and deletion but sacrifice data access speed.
- Graphs, compared to linked lists, provide richer logical information but require more memory space.
## 1.2.3   Relationship Between Data Structures and Algorithms
## 1.2.3   Relationship between data structures and algorithms
As shown in the Figure 1-4 , data structures and algorithms are highly related and closely integrated, specifically in the following three aspects:
@@ -45,7 +45,7 @@ Data structures and algorithms can be likened to a set of building blocks, as il
The detailed correspondence between the two is shown in the Table 1-1 .
<p align="center"> Table 1-1 &nbsp; Comparing Data Structures and Algorithms to Building Blocks </p>
<p align="center"> Table 1-1 &nbsp; Comparing data structures and algorithms to building blocks </p>
<div class="center-table" markdown>