| RankedBagTEnumeratorSkip Method |
Bypasses a supplied number of items and yields the remaining items.
Namespace:
Kaos.Collections
Assembly:
KaosCollections (in KaosCollections.dll) Version: 4.2.0.0
Syntax public RankedBagTEnumerator Skip(
int count
)
Parameters
- count
- Type: SystemInt32
Number of items to skip.
Return Value
Type:
RankedBagTEnumeratorThe items after the supplied offset.
Exceptions Remarks This is a O(log n) operation.
Examples
In the below snippet, both Skip operations perform an order of magnitude faster than their LINQ equivalent.
var bag = new RankedSet<int>() { 295 };
for (var i = 2; i < 500; i += 2) bag.Add (i);
foreach (int x in bag.Skip (100).SkipWhile (i => i%2==0).Skip (100))
Console.Write ($"{x} ");
See Also