Summary of data structures in Java

Source: Internet
Author: User

This article summarizes some of the data structures implemented in Java

Briefly:

List<?>: Linked list structure. In general, only the functions of ArrayList and Linkedlist,vector and stack can be implemented with list, which will not be described later.

Queue<?>: queues, which allow deletions only at the front end of a table (front), and in the back-end (rear) of a table, is a linear table of operations constrained. The end of the insert operation is called the tail of the queue, and the end of the delete operation is called the team header.

map<?,?: For storing key-value pairs of data, key-value pairs are stored in entry<?,?, and cannot store duplicate key values, when the same key value is appended, the value of the previous value,key is allowed to be empty.

Set<?>: implemented by the map package, the structure features are consistent with the map, but only single objects can be stored.

The data structure involved:

Stack: provides push and stack (POP) functions

queues: non-blocking methods for offer and pull, blocking methods for put and take

List : provides various functions such as add, find, remove, traverse, etc.

Tree: Red-black tree, usually used for random search, top n or sorting functions

Thread Safety

Queue, HashTable, Concurrenthashmap are thread-safe, the rest are unsafe, and the new Java lock is introduced later, and will be explained in depth.

Complexity of Time

Not to be continued

Summary of data structures in Java

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.