View Javadoc
1   /*
2    * Copyright (C) 2012 Alberto Irurueta Carro (alberto@irurueta.com)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.irurueta.sorting;
17  
18  /**
19   * Enumerator containing different algorithms for sorting arrays of data.
20   */
21  public enum SortingMethod {
22      /**
23       * Sorts data by using a straight insertion algorithm. This is a simple
24       * yet slow algorithm for sorting, although for small arrays might be
25       * fast enough.
26       */
27      STRAIGHT_INSERTION_SORTING_METHOD,
28  
29      /**
30       * Sorts data using Shell's sorting algorithm. This algorithm is an
31       * improvement over the straight insertion algorithm to achieve faster
32       * results.
33       */
34      SHELL_SORTING_METHOD,
35  
36      /**
37       * Sorts data using Quicksort algorithm. This is the fastest algorithm
38       * in average for sorting arrays of any size.
39       */
40      QUICKSORT_SORTING_METHOD,
41  
42      /**
43       * Sorts data using Heapsort algorithm. This algorithm is based on the
44       * idea of sorted trees, and performs better than straight insertions.
45       */
46      HEAPSORT_SORTING_METHOD,
47  
48      /**
49       * Uses Java SDK sorting algorithm. Performance depends on SDK
50       * implementation and functionality is limited to sorting only (indices
51       * cannot be retrieved).
52       */
53      SYSTEM_SORTING_METHOD
54  }