Common Java Data Structures & pros and cons

Source: Internet
Author: User

Array Advantages: Fast query, if you know the index can quickly access the disadvantage: Delete slow, size fixed ordered array advantages: Faster than unordered array lookup disadvantage: Delete and insert slow, size fixed stack advantages: Provide last-in-first-out access method disadvantage: Access to other items is slow queue advantages: Provide first-in-out access method disadvantage: access to other The items are slow. List Advantages: Quick Insert, delete fast disadvantage: find slow (each node) binary tree Advantages: Find, INSERT, delete both fast (balanced binary tree) disadvantage: Delete algorithm complex red-black tree Advantages: Find, INSERT, delete are fast, the tree is always balanced (local adjustment) Disadvantage: The algorithm is complex

2-3-4 Tree Advantages: Find, INSERT, delete are fast, the tree is always balanced. Similar trees are useful for disk storage disadvantages: Algorithmic complex Hash Table advantages: If the keyword is known, access speed is very fast, insert fast disadvantage: Delete slow, if you do not know the keyword access is slow, the use of the storage space is not sufficient advantages: INSERT, delete fast, access to the largest data very quickly disadvantage: access to other data items is slow Pros: Modeling weaknesses in the real world: Some algorithms are slow and complex

Common Java Data Structures & pros and cons

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.