59 Container sortedArrayWithRot
60 (SortedArrayIntWithRot, SortedArrayIntWithRot +
sizeof(SortedArrayIntWithRot) /
sizeof(
int));
62 (sortedArrayWithRot.begin(), sortedArrayWithRot.begin() + 4, sortedArrayWithRot.end());
65 for (
auto it = sortedArrayWithRot.begin(); it < sortedArrayWithRot.end() - 1; ++it)
66 EXPECT_LE(*it, *(it + 1));
71 Container sortedArrayPos
72 (SortedArrayIntPos, SortedArrayIntPos +
sizeof(SortedArrayIntPos) /
sizeof(
int));
73 MergeInPlace<IT>()(sortedArrayPos.begin(), sortedArrayPos.begin() + 5, sortedArrayPos.end());
76 for (
auto it = sortedArrayPos.begin(); it < sortedArrayPos.end() - 1; ++it)
77 EXPECT_LE(*it, *(it + 1));
82 Container randomArrayPos
83 (RandomArrayIntPos, RandomArrayIntPos +
sizeof(RandomArrayIntPos) /
sizeof(
int));
84 MergeInPlace<IT>()(randomArrayPos.end(), randomArrayPos.begin() + 3, randomArrayPos.begin());
87 for (
auto it = randomArrayPos.begin(); it < randomArrayPos.end(); ++it, ++i)
88 EXPECT_EQ(RandomArrayIntPos[i], *it);
94 MergeInPlace<IT>()(emptyArray.begin(), emptyArray.begin(), emptyArray.end());
99 Container uniqueValueArray(1, 511);
100 MergeInPlace<IT>()(uniqueValueArray.begin(), uniqueValueArray.end(), uniqueValueArray.end());
101 EXPECT_EQ(511, uniqueValueArray[0]);
106 Container doubleValuesArray(1, 511);
107 doubleValuesArray.push_back(66);
110 (doubleValuesArray.begin(), doubleValuesArray.begin() + 1, doubleValuesArray.end());
112 EXPECT_EQ(66, doubleValuesArray[0]);
113 EXPECT_EQ(511, doubleValuesArray[1]);
118 std::string stringToMerge = StringWithPivot;
120 (stringToMerge.begin(), stringToMerge.begin() + 4, stringToMerge.end());
123 for (
auto it = stringToMerge.begin(); it < stringToMerge.end() - 1; ++it)
124 EXPECT_LE(*it, *(it + 1));