Пример #1
0
    public void PushHeap()
    {
        NativeArrayIterator <int> pushHeapIt = FourTwoThreeOne.Begin().Copy(
            FourTwoThreeOne.End(),
            arrLong.Begin());

        pushHeapIt.SetCurrent(5);
        pushHeapIt = pushHeapIt.GetNext();
        arrLong.Begin().PushHeap(pushHeapIt, IsIntLessThanInt);
        Assert.That(arrLong, Is.EqualTo(new[] { 5, 4, 3, 1, 2, 0, 0, 0 }));
    }
Пример #2
0
    public void InplaceMerge()
    {
        NativeArrayIterator <int> copyResult = arr.Begin().Copy(
            arr.End(),
            arrLong.Begin());

        OneThreeThreeFour.Begin().Copy(OneThreeThreeFour.End(), copyResult);
        arrLong.Begin().InplaceMerge(
            copyResult,
            arrLong.End(),
            IsIntLessThanInt);
        Assert.That(arrLong, Is.EqualTo(new[] { 1, 1, 2, 2, 3, 3, 3, 4 }));
    }