Check the data structure of the soft

Source: Internet
Author: User

When it comes to data structures, let's first meet the data structure.

Data structures are widely used terminology throughout the field of computer science and technology. It is used to reflect the internal composition of a data. That is, a data is composed of those composition data, in what form, what structure. A word is what the data looks like in the program. How to use.

So let's get to know what the data looks like.

In the data structure, his appearance is called the structure, then the structure is divided into the logical structure and the storage structure, as if we dress. The logical structure is how we match, and the storage structure is the way we get dressed.

1, Structure

So how do they match in the data structure, in reality, we wear cotton clothes in winter. And in the summer we are half-sleeved with shorts and slippers, and girls in winter this is leggings and cotton clothes, summer is a skirt or shorts plus t-shirts, then the data. So let's introduce them.

1.1. Logical Structure

A linear structure is a set of different nodes (clothes) connected by a structure.

The tree structure is a node that has different nodes behind it, so that when we choose clothes, we have a choice. For example, to pass pants. So we choose trousers or shorts. This is a typical tree structure.

The graph is that each node does not have a certain order, when we match clothes because too many clothes reason is that we have no order. Especially the girls who shout without clothes all day.



1.2. storage structure

Sequential storage: is a set of data is relative to the order, for example, we passed the summer. Then we will put the autumn clothes behind the summer, and then directly take it.

Chained storage: Chained storage is the opposite of sequential storage. The connection is not necessarily the relative position, just want us to know where to be able. Clothes can throw away, but if we connect a line on the clothes. In the summer when we have to change the autumn clothes, but the cupboard inside are all summer clothes. But we have a line attached to the cupboard. The next season's clothes know where to go.

so with these two pairings, will we wear clothes without worrying about it? .

      2. Finishing

But there is a problem, I grew up with a problem, that is love to buy clothes, cabinets inside too many clothes, find a little difficult. So the data is a lot of truth, so in the data structure we have a way to find.

2.1. Find

Binary search: For example, we are a fastidious person, in the clothes when we will be the size, or color put, then we want to convey the color of the clothes can be directly in a pile of clothes to separate, and then according to the next half of the points in the continuation. Until you find the right clothes for you.

Index Lookup: This method of finding clothes of course we still have a good habit. Summer and winter clothes we still have to divide the good class, so we find the time to go directly to the autumn clothes to find.

Order Lookup: My God, I have no good habits. There's no way, you can look for one thing in your pair of clothes.

2.2. algorithm

See here we will find a good habit is how important, how to develop a good habit? method is very important. So here we draw out the algorithm, according to our situation, choose a good algorithm to arrange our clothes in order.

Insert: Directly find the clothes to be placed, and then put them in the appropriate position, of course, this method will let you and once put the clothes can be compared once.

At least one is the last.

Exchange: Is the wardrobe of clothes in turn and next to the comparison, right before and after the correct, not the same picture exchange order, compared to the first piece after the second, and so on.

Select: Select sort and swap very much like he is no longer confined and beside the comparison. It is the same as all the clothes behind. and then swap.

All right. Said here, looks like the clothes put also put. There's no problem with pairing. So I'm going to add new clothes. Or some clothes do not have to throw away, this is also related to the removal of clothes and join.

2.3. Accession and deletion

Let's say we put our clothes in a chain store, then we're going to add a piece of clothing, then we'll find the right place, then the front and back clothes all point at him, or delete a piece of clothing. Just put them back and forth, throw him away,

Suppose we are put together in sequential storage. Then we have to find the right place for the clothes, and then move the back of his clothes backwards, and finally join, remove the clothes in turn to move forward.

So much for saying. If there are any difficulties to see, we can take a look at this article based on this mind mapping.

In fact, the data structure seems very difficult, but suppose we live in a relationship. The structure of life is everywhere, and when we learn it should be a new knowledge. With the old classmates. Contact life, the preparation of our knowledge network.

Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

Check the data structure of the soft

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.