(3) Java data Structure--

Source: Internet
Author: User

Data structures in Java-nam Gu-blog Park
Http://www.cnblogs.com/tingxuelou/p/6686143.html

Linear table, linked list, hash table is a common data structure, in Java development, the JDK has provided us with a series of corresponding classes to implement the basic data structure.

The Java Toolkit provides a powerful data structure. The data structure in Java consists mainly of the following interfaces and classes:

1. Enumeration (enumeration): The enumeration (the enumeration) interface defines a way to retrieve contiguous elements from a data structure. It is also used in methods defined by traditional classes such as vectors and properties

2. Bit set (BitSet) 3. Vector (vectors) 4. Stacks (Stack)

5. Dictionary (Dictionary)

6. Hash table (Hashtable)

7. Attributes (properties)

These are all traditional sets of frameworks, although these classes are useful, but they lack a central, unified theme. For this reason, the way you use the vector class differs greatly from the way you use the Properties class.

The collection framework is designed to meet several goals.

    • The framework must be high-performance. The implementation of the basic set (dynamic array, linked list, tree, hash table) must also be efficient.
    • The framework allows different types of collections to work in a similar way, with a high degree of interoperability.
    • The expansion and adaptation of a set must be simple.

To do this, the entire collection framework is designed around a standard set of interfaces. You can use the standard implementations of these interfaces directly, such as LinkedList, HashSet, and TreeSet, and you can implement your own collections via these interfaces.

A collection framework is a unified schema used to represent and manipulate collections. All collection frames contain the following internal

    

1.list is a collection of stored order, which stores unordered collections and stores data that is not duplicated.

2.sortedset inherits from the set interface, which is used to store an ordered set.

3.map maps a unique key to a value.

4.map.entry describes an element in a map

The difference between set and list: Set is an unordered set, and list is an ordered set, using this interface to precisely control where elements are inserted, to be able to accurately access elements through the position of an index

Set retrieval efficiency, delete and insert efficiency, insert and delete do not cause element position change

Lists and arrays are similar and can grow dynamically, automatically increasing the length of the list based on the length of the actual data stored. Find element efficient, insert delete inefficient because it causes other elements to change position

(3) Java data Structure--

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.