From ff091f8229370c9c25c01db284495d9db81e168f Mon Sep 17 00:00:00 2001 From: darkmiracle2023 <115684369+darkmiracle2023@users.noreply.github.com> Date: Thu, 13 Oct 2022 10:34:51 +0530 Subject: [PATCH] Create binary_sort.cpp --- binary_sort.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 binary_sort.cpp diff --git a/binary_sort.cpp b/binary_sort.cpp new file mode 100644 index 0000000..a21ea06 --- /dev/null +++ b/binary_sort.cpp @@ -0,0 +1,55 @@ +// A C++ program to demonstrate working of sort(), +// reverse() +#include +#include +#include +#include //For accumulate operation +using namespace std; + +int main() +{ + // Initializing vector with array values + int arr[] = {10, 20, 5, 23 ,42 , 15}; + int n = sizeof(arr)/sizeof(arr[0]); + vector vect(arr, arr+n); + + cout << "Vector is: "; + for (int i=0; i()); + + cout << "\nVector after sorting in Descending order is: "; + for (int i=0; i