Examples of using a ListMergeSort on a DoubleLinkedList.
#include <stdexcept>
#include <iostream>
int main(int argc, char**argv) {
List list;
list.push_back(1);
list.push_back(0);
std::cout << "Sorted [ ";
for(List::iterator iter = list.begin(); iter != list.end(); ++iter) {
std::cout << *iter << " ";
}
std::cout << "]" << std::endl;
return 0;
}
Double Linked List defintion.
DoubleLinkedList-based Merge Sort.
DoubleLinkedList which can be iterated via DoubleLinkedList::iterator.
void push_back(const value_type &value)
Insert value as the last item in this list.
Merge Sort algorithm using lists to hold the data.
void sort(const Iterator begin, const Iterator end)
Sort from begin to end by copying.