Java: the difference between collections and “data structures”

In Java, I don't understand the relationship between sets and "data structures" In my opinion, set refers to list, set, map and queue, and "data structure" refers to the data structure used to implement set, such as array, linked list or tree For example, ArrayList and LinkedList are collections, but their data structures are an array and a linked list respectively Am I right or am I confused?

Solution

A data structure is how data in memory represents content How a collection is accessed I emphasize the word "can"

If you store data in a LinkedList and sort it, performance will degrade If the same algorithm uses ArrayList, its performance will be enhanced As long as you change the way it behaves in memory, it will contribute to various factors

You can use the set representation to access it, or you can use the index to access data You can also go to getfirst, GetNext, getprev

Confusion between your internal storage and storage access Separate 2

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>