Enum <E extends Enum <E> class and Sorting Algorithm

Source: Internet
Author: User
1 Enum <E extends Enum <E> class

This is a common basic class for all Java language enumeration types.

2. Common sorting algorithms
  • Bubble Method. Simple. This method can be used for small demands.
  • Fast sorting. Determine the keyword and divide the data into two parts: less than and greater than the keyword. Then recursively arrange the two parts.
  • Insert sorting. Data is divided into two parts: ordered and unordered. the unordered parts are traversed one by one, and records are inserted into ordered parts one by one. There is an improved semi-insertion sorting, that is, the insertion position is confirmed by binary search during insertion.
  • Hill sorting. Groups data intervals and inserts and sorts data in the group. The interval is gradually decreased until it is 1.
  • Select sort. Divide the data into two parts: ordered and unordered, traverse the unordered part, locate the smallest (or largest) element, and insert it to the end of the ordered part.
  • Heap sorting. Construct a binary heap.
  • Merge and sort. The two ordered data can be merged into an ordered data by means of merging and sorting. Therefore, we can manually divide the data to be sorted into two parts, and then merge and sort the data. Of course, each part requires recursive calling of Merge Sorting.

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.