Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the logical structure of java data structure

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "how to understand the logical structure of java data structure", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to understand the logical structure of data in java data structure.

Text

If the physical storage structure expresses the specific location of data storage, then the logical data storage structure we are going to discuss now expresses the relationship between data and data.

Logical structure, as the name implies, in fact, in the process of processing data, there are all kinds of relationships between data and data, so the purpose of using logical structure is to order these data. from a chaotic and intractable situation to an orderly and manageable situation.

Therefore, we know that in the logical structure, the most important thing is the logical relationship between data and data, which is related to whether the data is orderly, but also related to whether the data can be processed more easily. And this happens to be the reason why logical data structures are adopted in the computer world.

At this point, we have to say that the ultimate purpose of the data structure is to better and easier to deal with the data, so we know that the data structure (logical structure and physical structure) is often not isolated, but is closely related to algorithms and indexing techniques.

There are many kinds of logical data structures, such as set structure, tree structure, graphic structure, linear structure and so on. These different structures play a great role in different application scenarios, such as mysql database storage using tree structure, java data processing, often using set structure and so on.

These data structures make up the splendor of the computer world, but at the same time, although some of the data has been simplified, there is still a certain threshold to prevent us from recognizing it.

Next, let's take a look at these logical data structures one by one.

1. Set structure

Set structure, this data structure refers to all the data elements in this structure, the only property is that there is no relationship except that they belong to the same set.

For example, the List collection that is more common in java, when we use this collection and fill elements into this collection, we don't have to care about the relationship between these elements, but just need to store these elements in the collection. This is a typical collection structure.

two。 Linear structure

Generally speaking, most of the data structures are linear, so there is also a partition method to divide the logical structure into linear structure and nonlinear structure.

Linear structure means that there is an one-to-one relationship between the elements in the data structure. Generally speaking, linear structure can be divided into general linear table, restricted linear table (stack, queue, heap, string), generalized linear table (one-dimensional array, generalized table). The linear structure has a unique first place, and the online connection of each data is unique.

Linear list is different under different storage structure. Under sequential storage structure, it is reflected as sequential list, linked list storage structure, one-way linked list, two-way linked list and so on.

3. Tree structure

There is an one-to-many relationship between elements in the data structure.

Tree structure is a kind of important nonlinear data structure, in which binary tree is the most commonly used, and tree is a hierarchical structure defined for branch relations. it provides a natural representation method for the data with hierarchical or branching relationship in computer applications, and the information model described by tree structure is common in the objective world.

The tree structure is generally divided into general tree and binary tree.

4. Graphic structure

There are many-to-many relationships among the elements in the data structure.

The graph structure can be divided into directed graph and undirected graph, binary decision graph.

Summary

In the previous article, "Learning from scratch-> java data structures (1): physical storage structures", we talked about four storage structures:

Sequential storage structure

Linked list storage structure

Index storage structure

Hash storage structure

In this article, we talked about four logical structures:

Set structure

Linear structure

Tree structure

Graphic structure

Common data structures and uses

Four kinds of storage structures and four kinds of logical structures, in the computer world, through optimization into a lot of data structures that we understand, I summed up as follows:

Array: frequently queried, rarely added or deleted.

Linked list: frequent additions and deletions, few queries.

Stack: implement recursion.

Queue; simulated queue.

Hash table: fast access at the expense of space.

Binary tree: adding, deleting and searching are fast, but the logic is complicated.

Heap: a special tree that is used to sort many.

Figure: complex structures deal with complex problems.

At this point, I believe you have a deeper understanding of "how to understand the logical structure of java data structure". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report