I'm attempting to divide a vector into two distinct arrays. A text file's current int vector has one element per line. There is a list of random integers in the text file.
How I intend to approach it:
Right now, I'm thinking of making two ordinary int arrays, iterating over the whole vector, and copying n/2 elements to each array.
What I want to know is:
What is the classiest way to complete my task? I believe I can accomplish this without repeatedly iterating over the vector.
using namespace std;
vector<int> ifstream_lines(ifstream& fs)
while(fs >> temp)
vector<int> MergeSort(vector<int>& lines)
int split = lines.size() / 2;
lines = ifstream_lines(fs);