From 989ed51d6b565fe22a7a46edfd961ef28d260c83 Mon Sep 17 00:00:00 2001 From: TusharKrSoniTKS <90370349+TusharKrSoniTKS@users.noreply.github.com> Date: Thu, 19 May 2022 11:35:05 +0530 Subject: [PATCH] Update in identification if array is sorted or not Here the identification process of the array that it is sorted or not was not properly constructed. Addition of the if statement will ensure that a sorted array with duplicate entries can be entered and identified. --- algorithms/CPlusPlus/Arrays/remove-duplicates.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/algorithms/CPlusPlus/Arrays/remove-duplicates.cpp b/algorithms/CPlusPlus/Arrays/remove-duplicates.cpp index 34b6720d..5b4beed4 100644 --- a/algorithms/CPlusPlus/Arrays/remove-duplicates.cpp +++ b/algorithms/CPlusPlus/Arrays/remove-duplicates.cpp @@ -52,12 +52,14 @@ int max=-2147483647; for(int i=0;i>arr[i]; // checking if input array is sorted or not - if(arr[i]