search
HomeCommon ProblemWhat are the linear table operations?

What are the linear table operations?

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

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

Basic operations

  • ##MakeEmpty( L) This is a method to turn L into an empty list

  • ##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 at position i in L (1≤i≤n)
  • Prior(L,i) Get The predecessor element of i
  • Next (L, i) Take the successor element of i
  • Locate (L, x) This is a function, The function value is the position of element x in L
  • Insert (L, i, x) inserts element The elements are pushed back one position
  • Delete(L, p) Delete the element at position p from table L
  • IsEmpty( L) If table L is an empty table (length is 0), return true, otherwise return false
  • Clear (L) Clear all elements
  • Init (L) is the same as the first one, the initialized linear table is empty
  • Traverse (L) traverses and outputs all elements
  • Find (L , x) Find and return element
  • Update(L, x) Modify element
  • Sort(L) Re-press all elements as given Conditional sorting
  • strstr(string1,string2) is used to find the first address of string2 in string1 for character array

The above is the detailed content of What are the linear table operations?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment