org.omnaest.utils.sorting
Class SortUtil
java.lang.Object
org.omnaest.utils.sorting.SortUtil
public class SortUtil
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SortUtil
public SortUtil()
mergeSort
public static void mergeSort(SortUtil.ArbitraryStructureContext arbitraryStructureContext,
SortUtil.ComparableArbitraryStructureIndexPosition comparableArbitraryStructureIndexPosition,
SortUtil.MergeSortDataModify mergeSortDataModify,
boolean ascending)
- Sorts a given arbitrary structure with a mergesort algorithm.
The necessary access to the
arbitrary structure is the possibility to push (elements of an) index position to a stack,
where by this have to implemented by the client application.
Also there have to be
an index range with uninterrupted range of index positions, and there have to be a metric by a
comparison implied. Both have to be implemented by the client application, too.
- Parameters:
arbitraryStructureContext - comparableArbitraryStructureIndexPosition - mergeSortDataModify - ascending - if true, the list will be sorted ascending, if false descending- See Also:
SortUtil.ArbitraryStructureContext,
SortUtil.ComparableArbitraryStructureIndexPosition,
SortUtil.MergeSortDataModify
Copyright © 2013. All Rights Reserved.