jeudi 3 octobre 2019

How would this merge sort would look like in my main function?

Teacher gave us this code, we are supposed to test it and analyse it, I'm only interested in making it run, I've heen trying for a while and I a bit frustrated.

I'm not sure what it takes as input value, I tried two dinamic arrays, and a single one, my goal is making it run so I can further advance in my assignment.

#include "pch.h"
#include <iostream>

using namespace std;

template<class T>
void serial_merge(const T* xs, const T* xe, const T* ys, const T* ye, T* zs){
    while (xs != xe && ys != ye) {
        bool wich = *ys < *xs;
        *zs++ = move(wich ? *ys++:*xs++)
    }
    move(xs, xe, zs);
    move(ys, ye, zs);
}

Thank you !

Aucun commentaire:

Enregistrer un commentaire