All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.algorithms.Reversing
java.lang.Object
|
+----COM.objectspace.jgl.algorithms.Reversing
- public final class Reversing
- extends Object
The Reversing class contains generic reversing algorithms.
- See Also:
- ReversingExamples
-
reverse(BidirectionalIterator, BidirectionalIterator)
- Reverse a sequence.
-
reverse(Container)
- Reverse a container.
-
reverseCopy(BidirectionalIterator, BidirectionalIterator, OutputIterator)
- Copy the reverse of a sequence into another sequence of the same size.
-
reverseCopy(Container, Container)
- Copy the reverse of a container into another container.
-
reverseCopy(Container, OutputIterator)
- Copy the reverse of a container into a sequence.
reverse
public static void reverse(BidirectionalIterator first,
BidirectionalIterator last)
- Reverse a sequence. The time complexity is linear and the space complexity is
constant.
- Parameters:
- first - An iterator positioned at the first element of the sequence.
- last - An iterator positioned immediately after the last element of the sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
reverse
public static void reverse(Container container)
- Reverse a container. The time complexity is linear and the space complexity is
constant.
- Parameters:
- container - The container to reverse.
reverseCopy
public static OutputIterator reverseCopy(BidirectionalIterator first,
BidirectionalIterator last,
OutputIterator result)
- Copy the reverse of a sequence into another sequence of the same size. The
time complexity is linear and the space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the input sequence.
- last - An iterator positioned immediately after the last element of the input sequence.
- result - An iterator positioned at the first element of the output sequence.
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
- Throws: IllegalArgumentException
- If the iterators are incompatible.
reverseCopy
public static OutputIterator reverseCopy(Container input,
OutputIterator result)
- Copy the reverse of a container into a sequence. The time complexity is linear and
the space complexity is constant.
- Parameters:
- input - The input container.
- result - An iterator positioned at the first element of the output sequence.
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
reverseCopy
public static void reverseCopy(Container source,
Container destination)
- Copy the reverse of a container into another container. The time complexity is
linear and the space complexity is constant.
- Parameters:
- source - The source container.
- destination - The destination container.
- Returns:
- An iterator positioned immediately after the last element of the output sequence.
All Packages Class Hierarchy This Package Previous Next Index