From c77316b8f1dcc2b63ece1d760329ab4341f02ded Mon Sep 17 00:00:00 2001 From: Shantanu Mane <78042851+RndmCodeGuy20@users.noreply.github.com> Date: Sun, 10 Oct 2021 11:12:47 +0530 Subject: [PATCH 1/2] my change added : main --- STL/CPP/STL_sort.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 STL/CPP/STL_sort.cpp diff --git a/STL/CPP/STL_sort.cpp b/STL/CPP/STL_sort.cpp new file mode 100644 index 0000000..e71cc8c --- /dev/null +++ b/STL/CPP/STL_sort.cpp @@ -0,0 +1,32 @@ +/** + * @file STLsort.cpp + * @author Shantanu Mane (@RndmCodeGuy20) (shantanu.mane.200@outlook.com) + * @brief Simple sorting program using standard STL sort. + * @version 1.0.12 + * @date 2021-10-10 + * + * @copyright Copyright (c) 2021 + * + * @ref 1. Let Us C - Yashwant Kanetkar + * 2. Programming in ANSI C - E. Balagurusamy -> Test Project Appendix IV + */ + + // C++ program to demonstrate default behaviour of +// sort() in STL. +#include +using namespace std; + +int main() +{ + int arr[] = { 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 }; + int n = sizeof(arr) / sizeof(arr[0]); + + sort(arr, arr + n); + + cout << "\nArray after sorting using " + "default sort is : \n"; + for (int i = 0; i < n; ++i) + cout << arr[i] << " "; + + return 0; +} From 58706e7670d5bda9c75aa4cc2ec49d4c890dd2cf Mon Sep 17 00:00:00 2001 From: Shantanu Mane <78042851+RndmCodeGuy20@users.noreply.github.com> Date: Sun, 10 Oct 2021 11:21:16 +0530 Subject: [PATCH 2/2] optimisation : master --- STL/CPP/STL_sort.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/STL/CPP/STL_sort.cpp b/STL/CPP/STL_sort.cpp index e71cc8c..34e8b69 100644 --- a/STL/CPP/STL_sort.cpp +++ b/STL/CPP/STL_sort.cpp @@ -11,8 +11,6 @@ * 2. Programming in ANSI C - E. Balagurusamy -> Test Project Appendix IV */ - // C++ program to demonstrate default behaviour of -// sort() in STL. #include using namespace std;