Experiment 7
Experiment 7
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <chrono>
std::vector<int> L(n1);
std::vector<int> R(n2);
int i = 0, j = 0, k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
++i;
} else {
arr[k] = R[j];
++j;
}
++k;
}
int main() {
std::vector<int> sizes = {1000, 5000, 10000}; // Different
sizes for testing
return 0;
}
Output:
Array size: 1000
Observations:
1. Performance for Different Input Sizes: