0
テンプレートヒープクラスを作成し、カスタムイテレータクラスを使用して昇順にソートすることができました。逆の順序で並べ替える方法が不思議でした。テンプレートヒープクラスの逆ソート
template <typename T>
inline void Heap<T>::sort_heap(DynamicArrayIter<T> first, DynamicArrayIter<T> second) {
int size = 0;
for (DynamicArrayIter<T> iter = first; iter != second; ++iter) {
size++;
}
T temp;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size - 1; j++) {
if (contents.at(j) < contents.at(i)) {
temp = contents.at(i);
contents.at(i) = contents.at(j);
contents.at(j) = temp;
}
}
}
}
おかげで、SOZは