#include <iostream>
#include <cstdint>
#include <cstdlib>

#include "row.hpp"
#include "sort_algorithms.hpp"

using namespace std;

int main()
{
    int arr[] = {1, 2, 3, 4, 5};

    int* b = new int[10];
    for (int i = 0; i < 10; i++)
        b[i] = rand() % 100;

    row<int>* a = new row<int>(b, 10);

    cout << "Initial a: " << *a << endl;

    row<int> c(arr, 5);
    cout << "Initial c: " << c << endl;

    cout << "c[0] = " << c[0] << endl;
    cout << "a[0] = " << (*a)[0] << endl;

    a->at(0) = 3;
    cout << "Modified a[0] = " << (*a)[0] << endl;

    //bubble_sort(*a);
    //cout << "Bubble sort a: " << *a << endl;

    // Optional tests
    
    int arr2[] = {5,2,8,1,3};
    row<int> b2(arr2,5);
    quick_sort(*a);
    cout << "Quick sort: " << *a << endl;

    int arr3[] = {5,2,8,1,3};
    row<int> c2(arr3,5);
    enumeration_sort(c2);
    cout << "Enumeration sort: " << c2 << endl;
    

    delete a;
    delete[] b;

    return 0;
}
