FMLiveSwitchSort Class Reference

Encapsulates useful sorting utilities. More...

Instance Methods

(instancetype) - init
 

Class Methods

(void) + quickSortWithArray:comparer:
 Sorts an array using the in-place quick-sort algorithm. More...
 
(void) + quickSortWithArray:comparerBlock:
 Sorts an array using the in-place quick-sort algorithm. More...
 
(id, id+ quickSortWithArrayAndComparerBlock
 Sorts an array using the in-place quick-sort algorithm. More...
 
(FMLiveSwitchSort *) + sort
 

Detailed Description

Encapsulates useful sorting utilities.

Method Documentation

◆ init

- (instancetype) init

◆ quickSortWithArray:comparer:

+ (void) quickSortWithArray: (NSMutableArray< id > *)  array
comparer: (FMLiveSwitchFunction2< id, id, id > *)  comparer 

Sorts an array using the in-place quick-sort algorithm.

Parameters
arrayThe array of elements.
comparerThe function used to compare elements in the array - should return less than 0 if item 1 is less than item 2 (item 1 should appear before item 2), 0 if the items are equal, or more than 0 is item 1 is greater than item 2 (item 1 should appear after item 2).

◆ quickSortWithArray:comparerBlock:

+ (void) quickSortWithArray: (NSMutableArray< id > *)  array
comparerBlock: (FMLiveSwitchCompareResult(^)(id, id))  comparerBlock 

Sorts an array using the in-place quick-sort algorithm.

Parameters
arrayThe array of elements.
comparerBlockThe function used to compare elements in the array - should return less than 0 if item 1 is less than item 2 (item 1 should appear before item 2), 0 if the items are equal, or more than 0 is item 1 is greater than item 2 (item 1 should appear after item 2).

◆ quickSortWithArrayAndComparerBlock

+ (id, id) quickSortWithArrayAndComparerBlock

Sorts an array using the in-place quick-sort algorithm.

@inlineparam array The array of elements. @inlineparam comparerBlock The function used to compare elements in the array - should return less than 0 if item 1 is less than item 2 (item 1 should appear before item 2), 0 if the items are equal, or more than 0 is item 1 is greater than item 2 (item 1 should appear after item 2).

◆ sort

+ (FMLiveSwitchSort*) sort