Home>Article> Why is an array called a random storage structure?

Why is an array called a random storage structure?

藏色散人
藏色散人 Original
2020-05-09 10:50:36 8684browse

Why is an array called a random storage structure?

Why is the array called a random storage structure?

In computer science, random storage represents access to a random component of a sequence at the same time. The opposite is called sequential access, which means it takes more time to access a remote component.

The array uses a continuous storage space for storage, and the elements are stored one by one. If you know the position of the first element, you can directly know the position of the x-th element, which can be done in O(1 ) time access, which conforms to the definition of random storage, so it is a random storage structure.

The above is the detailed content of Why is an array called a random storage structure?. 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