DAA Lab1
DAA Lab1
DAA Lab1
int i = 0, j = 0, k = left;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
nums[k] = L[i];
i++;
} else {
nums[k] = R[j];
j++;
}
k++;
}
int main() {
int nums[] = {1, 12, 6, 8, 10};
int size_nums = sizeof(nums) / sizeof(nums[0]);
if (choice == 1) {
bubbleSort(nums, size_nums);
} else if (choice == 2) {
quickSort(nums, 0, size_nums - 1);
} else if (choice == 3) {
selectionSort(nums, size_nums);
} else if (choice == 4) {
mergeSort(nums, 0, size_nums - 1);
} else {
cout << "Invalid choice. Exiting.\n";
return 1;
}
if (!found) {
cout << "Element " << search_element << " not found.\n";
}
return 0;
}