Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the linear table operations?

Shulou Source: shulou.com Published: 2022-06-03 02:54:43 10月02日 Update

In this issue, the editor will bring you about what linear table operations there are. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

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).

Basic operation

MakeEmpty (L) this is a way to make L an empty table.

Length (L) returns the length of table L, that is, the number of elements in the table

Get (L ≤ I) this is a function whose value is the element (1 ≤ I ≤ n) at position I in L.

Prior (LBI) takes the precursor element of I

Next (Lmemi) takes the successor element of I

Locate (LMagnex) this is a function whose value is the position of element x in L.

Insert inserts the element x at the position I of table L, pushing back the elements that originally occupied position I and the elements that follow.

Delete (LQuery p) removes the element at position p from table L

IsEmpty (L) returns true if table L is empty (length 0), false otherwise

Clear (L) clears all elements

Init (L) is the same as the first, initializing the linear table is empty

Traverse (L) traverses all the elements

Find (LMagne x) finds and returns elements

Update (LMagne x) modifies elements

Sort (L) reorders all elements according to the given criteria

Strstr (string1,string2) is used to find the first address of string2 in the string1 of character arrays.

These are the linear tables that the editor has shared for you. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Element linear data location function this is content hierarchy data structure structure length analysis storage same one-to-one professional number small and medium between rich in content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux Shulou Information Shulou Technology vpn