#import <ObjectiveLib/Algorithm.h>
Static Public Member Functions | |
Searches | |
(OLForwardIterator *) | + adjacentFindFrom:to: |
Find the first instance of adjacent elements. | |
(OLForwardIterator *) | + adjacentFindFrom:to:predicate: |
Find the first instance of adjacent elements. | |
(BOOL) | + binarySearchFrom:to:value: |
Perform a binary search. | |
(BOOL) | + binarySearchFrom:to:value:predicate: |
Perform a binary search. | |
(unsigned) | + countFrom:to:predicate: |
Count elements. | |
(unsigned) | + countFrom:to:value: |
Count elements. | |
(OLPair *) | + equalRangeFrom:to:value: |
Find the equal range of a given value. | |
(OLPair *) | + equalRangeFrom:to:value:predicate: |
Find the equal range of a given value. | |
(OLForwardIterator *) | + findEndFrom:to:subFrom:subTo: |
Find the last occurrence of a subsequence in a given range. | |
(OLForwardIterator *) | + findEndFrom:to:subFrom:subTo:predicate: |
Find the last occurrence of a subsequence in a given range. | |
(OLForwardIterator *) | + findFirstFrom:to:ofFrom:ofTo: |
Find any of a set of values. | |
(OLForwardIterator *) | + findFirstFrom:to:ofFrom:ofTo:predicate: |
Find any of a set of values. | |
(OLForwardIterator *) | + findFrom:to:if: |
Find an element. | |
(OLForwardIterator *) | + findFrom:to:value: |
Find an element. | |
(BOOL) | + includesFrom:to:subFrom:subTo: |
Determine whether one range exists in another range. | |
(BOOL) | + includesFrom:to:subFrom:subTo:predicate: |
Determine whether one range exists in another range. | |
(OLForwardIterator *) | + lowerBoundFrom:to:value: |
Find the first position at which a value may be inserted without disturbing the sorting order. | |
(OLForwardIterator *) | + lowerBoundFrom:to:value:predicate: |
Find the first position at which a value may be inserted without disturbing the sorting order. | |
(OLForwardIterator *) | + maxElementFrom:to: |
Find the element with the highest value. | |
(OLForwardIterator *) | + maxElementFrom:to:predicate: |
Find the element with the highest value. | |
(OLForwardIterator *) | + minElementFrom:to: |
Find the element with the lowest value. | |
(OLForwardIterator *) | + minElementFrom:to:predicate: |
Find the element with the lowest value. | |
(OLPair *) | + mismatchFrom:to:with: |
Find the first position where two ranges differ. | |
(OLPair *) | + mismatchFrom:to:with:predicate: |
Find the first position where two ranges differ. | |
(OLForwardIterator *) | + searchFrom:to:count:value: |
Search for a number of consecutive instances of an object. | |
(OLForwardIterator *) | + searchFrom:to:count:value:predicate: |
Search for a number of consecutive instances of an object. | |
(OLForwardIterator *) | + searchFrom:to:subFrom:subTo: |
Find a subsequence within a given range. | |
(OLForwardIterator *) | + searchFrom:to:subFrom:subTo:predicate: |
Find a subsequence within a given range. | |
(OLForwardIterator *) | + upperBoundFrom:to:value: |
Find the last position at which a value may be inserted without disturbing the sorting order. | |
(OLForwardIterator *) | + upperBoundFrom:to:value:predicate: |
Find the last position at which a value may be inserted without disturbing the sorting order. | |
Copying | |
(OLBidirectionalIterator *) | + copyBackwardFrom:to:destination: |
Copy elements. | |
(OLForwardIterator *) | + copyFrom:to:destination: |
Copy elements. | |
Comparisons | |
(BOOL) | + equalFrom:to:with: |
Test whether two ranges are equal. | |
(BOOL) | + equalFrom:to:with:predicate: |
Test whether two ranges are equal. | |
(BOOL) | + lexicographicalCompareFrom:to:andFrom:andTo: |
Compare two ranges lexicographically. | |
(BOOL) | + lexicographicalCompareFrom:to:andFrom:andTo:predicate: |
Compare two ranges lexicographically. | |
(id) | + max:or: |
Return the maximum of two elements. | |
(id) | + max:or:predicate: |
Return the maximum of two elements. | |
(id) | + min:or: |
Return the minimum of two elements. | |
(id) | + min:or:predicate: |
Return the minimum of two elements. | |
Transformations | |
(void) | + fillFrom:count:value: |
Assign a given value to a number of elements. | |
(void) | + fillFrom:to:value: |
Assign a value to a range of elements. | |
(void) | + forEachFrom:to:function: |
Perform an operation on each element in a given range. | |
(BOOL) | + nextPermutationFrom:to: |
Turn a range into its next permutation. | |
(BOOL) | + nextPermutationFrom:to:predicate: |
Turn a range into its next permutation. | |
(BOOL) | + prevPermutationFrom:to: |
Turn a range into its previous permutation. | |
(BOOL) | + prevPermutationFrom:to:predicate: |
Turn a range into its previous permutation. | |
(void) | + randomShuffleFrom:to: |
Reorder a sequence of elements randomly. | |
(void) | + randomShuffleFrom:to:randGen: |
Reorder a sequence of elements randomly. | |
(OLForwardIterator *) | + removeCopyFrom:to:destination:if: |
Copy a range while selectively removing elements. | |
(OLForwardIterator *) | + removeCopyFrom:to:destination:value: |
Copy a range while selectively removing elements. | |
(OLForwardIterator *) | + removeFrom:to:if: |
Remove elements from a range. | |
(OLForwardIterator *) | + removeFrom:to:value: |
Remove elements from a range. | |
(OLForwardIterator *) | + replaceCopyFrom:to:destination:if:newValue: |
Copy a range while selectively replacing elements. | |
(OLForwardIterator *) | + replaceCopyFrom:to:destination:oldValue:newValue: |
Copy a range while selectively replacing elements. | |
(void) | + replaceFrom:to:if:newValue: |
Replace values in a range. | |
(void) | + replaceFrom:to:oldValue:newValue: |
Replace values in a range. | |
(OLForwardIterator *) | + reverseCopyFrom:to:destination: |
Copy a range in reverse order. | |
(void) | + reverseFrom:to: |
Reverse the order of a range of elements. | |
(OLForwardIterator *) | + rotateCopyFrom:middle:to:destination: |
Copy a range and rotate it in one step. | |
(OLForwardIterator *) | + rotateFrom:middle:to: |
Rotate a given range. | |
(OLForwardIterator *) | + transformFrom:to:destination:function: |
Transform a range. | |
(OLForwardIterator *) | + transformFrom:to:withArgsFrom:destination:function: |
Transform a range. | |
(OLForwardIterator *) | + uniqueCopyFrom:to:destination: |
Copy a range while eliminating duplicates. | |
(OLForwardIterator *) | + uniqueCopyFrom:to:destination:predicate: |
Copy a range while eliminating duplicates. | |
(OLForwardIterator *) | + uniqueFrom:to: |
Remove consecutive elements from a range. | |
(OLForwardIterator *) | + uniqueFrom:to:predicate: |
Remove consecutive elements from a range. | |
Merges | |
(void) | + inPlaceMergeFrom:middle:to: |
Merge two consecutive ranges. | |
(void) | + inPlaceMergeFrom:middle:to:predicate: |
Merge two consecutive ranges. | |
(OLForwardIterator *) | + mergeFrom:to:andFrom:andTo:destination: |
Merge two sorted ranges. | |
(OLForwardIterator *) | + mergeFrom:to:andFrom:andTo:destination:predicate: |
Merge two sorted ranges. | |
Heaps | |
(BOOL) | + isHeapFrom:to: |
Test whether a range is a heap. | |
(BOOL) | + isHeapFrom:to:predicate: |
Test whether a range is a heap. | |
(void) | + makeHeapFrom:to: |
Convert the given range into a heap. | |
(void) | + makeHeapFrom:to:predicate: |
Convert the given range into a heap. | |
(void) | + popHeapFrom:to: |
Remove the top element of the heap. | |
(void) | + popHeapFrom:to:predicate: |
Remove the top element of the heap. | |
(void) | + pushHeapFrom:to: |
Add an element to a heap. | |
(void) | + pushHeapFrom:to:predicate: |
Add an element to a heap. | |
Sorting | |
(BOOL) | + isSortedFrom:to: |
Test whether a given range is sorted. | |
(BOOL) | + isSortedFrom:to:predicate: |
Test whether a given range is sorted. | |
(void) | + nthElementFrom:nth:to: |
Partially sort a given range. | |
(void) | + nthElementFrom:nth:to:predicate: |
Partially sort a given range. | |
(OLRandomAccessIterator *) | + partialSortCopyFrom:to:destinationFrom:destinationTo: |
Partially sort a given range. | |
(OLRandomAccessIterator *) | + partialSortCopyFrom:to:destinationFrom:destinationTo:predicate: |
Partially sort a given range. | |
(void) | + partialSortFrom:middle:to: |
Partially sort a given range. | |
(void) | + partialSortFrom:middle:to:predicate: |
Partially sort a given range. | |
(void) | + sortFrom:to: |
Sort a given range. | |
(void) | + sortFrom:to:predicate: |
Sort a given range. | |
(void) | + sortHeapFrom:to: |
Sort a heap. | |
(void) | + sortHeapFrom:to:predicate: |
Sort a heap. | |
(void) | + stableSortFrom:to: |
Sort a given range stably. | |
(void) | + stableSortFrom:to:predicate: |
Sort a given range stably. | |
Partitioning | |
(OLBidirectionalIterator *) | + partitionFrom:to:predicate: |
Partition a range. | |
(OLForwardIterator *) | + stablePartitionFrom:to:predicate: |
Partition a range stably. | |
Sets | |
(OLForwardIterator *) | + setDifferenceFrom:to:andFrom:andTo:destination: |
Find the difference of two sets. | |
(OLForwardIterator *) | + setDifferenceFrom:to:andFrom:andTo:destination:predicate: |
Find the difference of two sets. | |
(OLForwardIterator *) | + setIntersectionFrom:to:andFrom:andTo:destination: |
Find the intersection of two sets. | |
(OLForwardIterator *) | + setIntersectionFrom:to:andFrom:andTo:destination:predicate: |
Find the intersection of two sets. | |
(OLForwardIterator *) | + setSymmetricDifferenceFrom:to:andFrom:andTo:destination: |
Find the symmetric difference of two sets. | |
(OLForwardIterator *) | + setSymmetricDifferenceFrom:to:andFrom:andTo:destination:predicate: |
Find the symmetric difference of two sets. | |
(OLForwardIterator *) | + setUnionFrom:to:andFrom:andTo:destination: |
Find the union of two sets. | |
(OLForwardIterator *) | + setUnionFrom:to:andFrom:andTo:destination:predicate: |
Find the union of two sets. | |
Swapping | |
(void) | + swap:and: |
Swap two elements. | |
(void) | + swapIterators:and: |
Swap elements to which iterators point. | |
(OLForwardIterator *) | + swapRangesFrom:to:with: |
Swap elements in two ranges. |
Algorithms are separated from the underlying data structures on which they operate through the use of iterators. Algorithms are only given iterators as arguments, and have no information about what kind of collection the iterators might be from.
|