Algorithm (4th edition)-2.5 applications

Source: Internet
Author: User

2.5.1 sorting all sorts of data

· Trading Services

· Pointer sort

· Immutable keys

· Cheap Exchange.

· Multiple sorting methods

· Multi-key Array

· Using the comparator to implement a priority queue

· Stability: Ability to preserve the relative position of repeating elements in an array

Stabilize: Insert Sort, merge sort

Instability: Select Sort, Hill sort, quick sort, heap sort

2.5.2 What sort algorithm should I use

1. Fast sorting is the fastest general-purpose sorting algorithm.

2. Sort the raw type data: Skipping references can save us the space required to store all references and the cost of accessing the array by reference, not to mention the overhead of calling the CompareTo () and less () methods.

3. The Java system programmer chooses to use (three-slice) a quick sort for the original data type, using a merge sort on the reference type.

These choices actually imply the exchange of speed and space (for the original data type) for stability (for reference types).

2.5.3 about the problem

1. Attribution refers to an algorithm invented to solve a problem that can be used to solve another problem.

2. On average, the run time of the segmentation-based selection algorithm is linear.

2.5.4 Sort Application List

· Business Computing

· Information search

· Operational research: study mathematical models and apply them to the areas of problem-solving and decision-making

· Event-driven simulations

· Numerical calculation

· Combination Search

Algorithm (4th edition)-2.5 applications

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.