Rishi Lab-10
Rishi Lab-10
Rishi Lab-10
int main() {
int n;
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
quickSort(arr, 0, n - 1);
return 0;
}
CPP CHECK:-
TEST CASES:-
CUSTOM TEST CASES:-
while (!q.empty()) {
int u = q.front();
q.pop();
return true;
}
int main() {
int n;
cin >> n;
if (is_bipartite(graph, n)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
CPP CHECK:-
TEST CASES:-
int main() {
int n,m;
cin >> n;
vector<int> arr;
for(int i=0;i<n;i++){
cin >> m;
arr.push_back(m);
}
mergeSort(arr, 0, n - 1);
for (int i = 0; i < n; i++) {
cout << arr[i] << " " ;
}
cout << endl;
return 0 ;
}
CPP CHECK:-
TEST CASES:-
if (largest != i) {
swap(arr[i], arr[largest]);
heapify(arr, n, largest);
}
}
int main() {
int n;
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
heap_sort(arr, n);
return 0;
}
CPP CHECK:-
TEST CASES:-
CUSTOM TEST CASES:-