“This is the fourth day of my participation in the First Challenge 2022. For details: First Challenge 2022”
Hello, everyone, I am a pig ruffian bully, entry less than a year with a student, please take care of.
The data structure
concept
- In a computer, the way data is stored and organized
- Understand data structures to store and organize data in an efficient manner
application
We illustrate data structures through real-life applications
-
The garage that cut in line
I drove my donkey to park in the parking lot of the mall, but now there is only one parking space, and there is another car behind the parking space. At this time, the concept of stack is applied, advance and exit, and I can only drive to that position when the car exits.
-
A bank vault
The vault of the bank stores articles and property in a specific way, which can be arranged by the initials of the depositor or by the amount of the property stored. Then in the search process, the complexity of the search reflects the arrangement and characteristics, which reflects the data structure in the computer.
-
A long queue
In our daily life, queues are often carried out. In the process of queuing, the head goes out and the tail goes in, which is the queue in data structure.
-
, etc.
To sum up, the data structure considers the way to store data in different scenarios and reflects the efficiency of operation such as relative search.
Common data structures
Different types of data structures have different application scenarios, and their performance varies according to different scenarios. In the process of real use, the choice should be based on the actual needs of development.
- Arrays: Arrays are structures in which multiple elements can be stored consecutively in memory and allocated consecutively in memory
- Stack: A stack is a special linear table that can operate only at one end of the linear table. Operations are allowed at the top of the stack and not at the bottom of the stack
- Queue: A queue is a linear table that operates at both ends of the table. The first queue is allowed out and the last queue is allowed in
- Linked list: A linked list is a discontinuous, nonsequential storage structure on a physical storage cell, discontinuous in comparison to an array
- Tree: by n (n>=1) finite nodes composed of a hierarchical relationship of the set
- Heap: An array object that can be thought of as a tree
algorithm
concept
- A set of decoration scheme, if a program of any language than as a house, the algorithm is a decoration scheme
- What kind of decoration is the algorithm, to optimize our house is the program
- It doesn’t depend on language
application
-
The behavior of bubbles in water
Known as the bubble sort is one of the beginners of commonly used algorithm, compare the two adjacent bubbles, if the first is greater than the second, and then swapping two bubbles, for each pair of adjacent bubbles do the same things, and a bubble until there is no any need to exchange, and the bubble is the need to compare the elements, at the same time, it also embodies the algorithm input & output