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

The sequential search method is suitable for linear tables with what structure to store.

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article will explain in detail what structure the sequential search method is suitable for storing linear tables. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The sequential lookup method is suitable for storing linear tables whose structure is "sequential storage or link storage". Linear tables are mainly represented by sequential representation (sequential storage) or chained representation (linked storage). Sequential representation refers to the sequential storage of the data elements of a linear table with a set of consecutive address storage units. chain representation refers to the storage of data elements in a linear table with an arbitrary set of storage units.

Sequential search method

Sequential search refers to searching one by one from beginning to end.

Lookup is one of the most commonly used algorithms in programming. Assuming that the value of x exists from n integers, the most primitive way is to find it one by one from beginning to end, which is called sequential lookup.

Linear table

Linear table is the most basic, simplest and most commonly used data structure. Linear table (linear list) is a kind of data structure. A linear table is a finite sequence of n data elements with the same characteristics.

The relationship between data elements in a linear table is one-to-one, that is, except for the first and last data elements, all data elements are connected from end to end. (note that this sentence applies only to most linear tables, not all. For example, a circular linked list is also a linear table at the logical level (linked storage at the storage level, but points the tail pointer of the last data element to the first node).

Linear tables are mainly represented by sequential representation or chained representation. In practical applications, it is often used in special forms such as stack, queue, string and so on.

Sequential representation refers to the sequential storage structure or sequential image (sequential mapping) of a linear table in which data elements of a linear table are sequentially stored in a set of storage units with consecutive addresses. It uses "physical location adjacency" to represent the logical relationship between data elements in a linear table, and can randomly access any element in the table.

Chained representation refers to the linked storage structure of linear tables, which uses a set of arbitrary storage units to store data elements in linear tables. Its memory cells can be continuous or discontinuous. When representing the logical relationship between data elements, in addition to storing its own information, it is also necessary to store information indicating its direct successor (that is, the storage location of the direct successor). These two parts of information constitute the storage image of the data elements, called node. It includes two domains; the domain in which the data element information is stored is called the data domain; and the domain in which the direct subsequent storage location is stored is called the pointer domain. The information stored in the pointer domain is called a pointer or chain.

This is the end of the article on "the linear table of what structure is suitable for sequential search". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.

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: 299

*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

Internet Technology

Wechat

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

12
Report