Rauf Khann C M M File
Rauf Khann C M M File
#include <iostream>
using namespace std;
int main() {
int arr[] = {10, 25, 30, 40, 50};
int size = sizeof(arr) / sizeof(arr[0]);
int target;
cout << "Enter the number to search: ";
cin >> target;
if (result != -1) {
cout << "Element found at index " << result << endl;
} else {
cout << "Element not found in the array." << endl;
}
return 0;
}
write a program that implement a Binary search in
c++
#include <iostream>
using namespace std;
int main() {
int arr[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
int size = sizeof(arr) / sizeof(arr[0]);
int target;
if (result != -1) {
cout << "Element found at index " << result << endl;
} else {
cout << "Element not found in the array." << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main() {
int arr[] = {64, 34, 25, 12, 22, 11, 90};
int size = sizeof(arr) / sizeof(arr[0]);
cout << "Unsorted array: ";
printArray(arr, size);
bubbleSort(arr, size);
return 0;
}
#include <iostream>
using namespace std;
Node(int value) {
data = value;
left = right = nullptr;
}
};
return 0;
}