Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

ADT linear table

Shulou Source: shulou.com Published: 2022-06-03 02:53:40 11月07日 Update

The collection of data objects in the Data linear table is {A1, a2,..., an}, and each element is of type DataType. Among them, except for the first element A1, each element has one and only one direct predecessor element, and except the last element, an, each element has and only one direct successor element. The relationship between data elements is one-to-one. Operation InitList (* L): initializes the operation to create an empty linear table L. ListEmpty (L): determines whether the linear table is empty, returns true if the linear table is empty, returns false otherwise. ClearList (* L): clears the linear table. GetElem (L, I, * e): returns the I position element in the linear table L to e. LocateElem (L, e): looks for an element in the linear table L that is equal to the given value e. If the lookup is successful, the returned element has an ordinal number in the table indicating success; otherwise, returning 0 indicates failure. ListInsert (* L, I, e): inserts a new element e in position I in the linear table L. ListDelete (* L, I, * e): deletes the I position element in the linear table L and returns its value with e. ListLength (L): returns the number of elements in linear table L. End for different applications, the basic operations of linear tables are different, the above operations are the most basic. For the more complex operations of linear tables involved in practical problems, we can use the combination of these basic operations to achieve.

Tags: Element linear individual different successful only basic operation data online complex one-to-one number between precursor actual object serial number type problem successor Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Huawei macOS vpn Apple