What is data structure?

Source: Internet
Author: User

I remember that when I took the postgraduate entrance exam, my professional courses were data structures and C ++. In order to prepare for the exam, I found the classic data structure teaching material of teacher Yan Yumin, I used C ++ to implement all the algorithms mentioned above. Unfortunately, my blog didn't become so popular today. Otherwise, I could write some experiences like guojing.
In the evening, I pulled the book out. After a long time, I couldn't read it. It was a bit dusty and I was able to turn it over and look at the dense notes recorded in the book.

This essay is just a general review and review of the data structure, so I only care about one problem, that is:What is a data structure?
Computer software is derived from the development of computer hardware. What is computer software used? What is the usefulness of the code we write on a normal day?Software is used to make people's lives more convenient and efficient. This is my understanding of the use of software.Software frees people from the vortex of repetitive work so that they can have the opportunity to do more challenging and productive work, to further improve the Wealth Creation Ability of the whole society.
If you want the software to solve the problem, you must have some mathematical models to abstract the problem to be solved. The most typical one is that the mathematical modeling competition, which has been very popular for a few years, raises a question, through mathematical modeling, we can obtain an approximate solution, which is usually an optimal model. However, the problems in reality are much more complicated. In many cases, we cannot abstract them through mathematical models. At this moment, we will introduce the data structure.
The problems to be solved in reality have the following characteristics: 1. it generally includes some data, which may be simple data, such as the age and birthday of employees. It may also be complicated data, such as the employees themselves, it is a complex data composed of a series of simple data such as height, weight, age, and birthday. 2. Data is often associated, which may be one-to-one, one-to-many, or many-to-many. 3. data usually contains some operations, just like adding, subtracting, multiplication, and division between integers.
A Data Structure is a set of data elements that have one or more specific relationships with each other. In our daily work, we also encounter another very common concept: data type, which refers to a set of values and a group of operations defined in this value set. When talking about the data type, don't forget that it includes a group of operations.
Next we will continue to focus on how to use the data structure in the computer. The relationship between the data elements mentioned in the data structure is divided into two types: logical and physical. Logically, it mainly refers to one-to-one, one-to-many, or many-to-many. Physically, it refers to the storage method of data elements in storage devices, ordered images and non-sequential images are classified into two types. Ordered images are stored adjacent to data elements in the memory. After we know the location of an element, you can determine the positions of other elements by means of relative positions. an unordered image means that elements are connected by pointers.
With the data type, we need to determine how to use the data type to solve the actual problem, that is, determine the algorithm. An algorithm is a description of a specific problem solving step. It is a finite sequence of commands, and each instruction represents one or more operations. Algorithms have the following features: 1. Poor; 2. deterministic; 3. feasibility; 4. input; 5. output.
A good algorithm has the following requirements: 1. correctness; 2. readability; 3. robustness; 4. Efficiency and low storage, that is, optimization of time and space.
We can determine the advantages and disadvantages of algorithms through time complexity or space complexity.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.