Template Algorithms For Sorted Sets
|
|
template <class C, class L> C& AppendSorted(C& dest, const C& src, const L& less)
Merges source NTL container to destination NTL container. Both containers must be sorted in ascending order. After the operation, destination container is sorted in ascending order and contains values from both containers. Duplicate values are preserved. Ordering predicate is determined by less.
|
dest |
Destination container. |
|
Return value |
Destination container.template<class C> |
template <class C> C& AppendSorted(C& dest, const C& src)
Merges source NTL container to destination NTL container. Both containers must be sorted in ascending order. After the operation, destination container is sorted in ascending order and contains values from both containers. Duplicate values are preserved. Ordering is determined by operator<.
|
dest |
Destination container. |
|
Return value |
Destination container.template<class C> |
template <class C, class L> C& UnionSorted(C& dest, const C& src, const L& less)
Merges source NTL container to destination NTL container. Both containers must be sorted in ascending order and values must be unique. After the operation, destination container is sorted in ascending order and contains unique values from both containers. Ordering is determined by less.
|
dest |
Destination container. |
|
Return value |
Destination container. |
template <class C> C& UnionSorted(C& dest, const C& src)
Merges the source NTL container to the destination NTL container. Both containers must be sorted in ascending order and values must be unique. After the operation, destination container is sorted in ascending order and contains unique values from both containers. Ordering is determined by operator<.
|
dest |
Destination container. |
|
Return value |
Destination container. |
template <class C, class L> C& RemoveSorted(C& from, const C& what, const L& less)
Removes elements of source container from destination container. Both containers must be sorted in ascending order and values must be unique. Ordering is determined by less.
|
from |
Destination container. |
|
Return value |
Destination container. |
template <class C> C& RemoveSorted(C& from, const C& what)
Removes elements of source container from destination container. Both containers must be sorted in ascending order and values must be unique. Ordering is determined by operator<.
|
from |
Destination container. |
|
Return value |
Destination container. |
template <class D, class S, class L> D& IntersectSorted(D& dest, const S& src, const L& less)
Removes elements from destination container that are not contained in source container. Both containers must be sorted in ascending order and values must be unique. Ordering is determined by less.
|
D |
Type of destination container. |
|
S |
Type of source container. |
|
dest |
Destination container. |
|
less |
Destination container. |
template <class D, class S> D& IntersectSorted(D& dest, const S& src)
Removes elements from destination container that are not contained in source container. Both containers must be sorted in ascending order and values must be unique. Ordering is determined by operator<.
|
D |
Type of destination container. |
|
S |
Type of source container. |
|
dest |
Destination container. |
|
Return value |
Destination container. |
|