From fb31979c03f0b69874cf0b544b8983446fbab9fe Mon Sep 17 00:00:00 2001 From: Chetan Kaushik Date: Tue, 2 Aug 2016 15:37:19 +0530 Subject: [PATCH] Renamed Files according to naming conventions --- ...left_rotation.cpp => ArrayLeftRotation.cpp | 60 +++++++++--------- ...ght_rotation.cpp => ArrayRightRotation.cpp | 62 +++++++++---------- 2 files changed, 61 insertions(+), 61 deletions(-) rename Array_left_rotation.cpp => ArrayLeftRotation.cpp (94%) rename Array_right_rotation.cpp => ArrayRightRotation.cpp (95%) diff --git a/Array_left_rotation.cpp b/ArrayLeftRotation.cpp similarity index 94% rename from Array_left_rotation.cpp rename to ArrayLeftRotation.cpp index 11fa154d1..36278e1bb 100644 --- a/Array_left_rotation.cpp +++ b/ArrayLeftRotation.cpp @@ -1,30 +1,30 @@ -#include -using namespace std; -int main(){ - int n,k; - cout<<"Enter size of array=\t"; - cin>>n; - cout<<"Enter Number of indeces u want to rotate the array to left=\t"; - cin>>k; - int a[n];cout<<"Enter elements of array=\t"; - for(int i=0;i>a[i]; - } - int temp=0; - for(int i=0;i +using namespace std; +int main(){ + int n,k; + cout<<"Enter size of array=\t"; + cin>>n; + cout<<"Enter Number of indeces u want to rotate the array to left=\t"; + cin>>k; + int a[n];cout<<"Enter elements of array=\t"; + for(int i=0;i>a[i]; + } + int temp=0; + for(int i=0;i -using namespace std; -int main(){ - int n,k; - cout<<"Enter size of array=\t"; - cin>>n; - cout<<"Enter Number of indices u want to rotate the array to right=\t"; -cin>>k; -int a[n]; -cout<<"Enter elements of array=\t"; - for(int i=0;i>a[i]; - int temp=0; - for(int i=0;i=0;j--){ - if(j==0){ - a[j]=temp; - } - else{ - a[j]=a[j-1];} - - } - - } - cout<<"Your rotated array is=\t"; - for(int i=0;i +using namespace std; +int main(){ + int n,k; + cout<<"Enter size of array=\t"; + cin>>n; + cout<<"Enter Number of indices u want to rotate the array to right=\t"; +cin>>k; +int a[n]; +cout<<"Enter elements of array=\t"; + for(int i=0;i>a[i]; + int temp=0; + for(int i=0;i=0;j--){ + if(j==0){ + a[j]=temp; + } + else{ + a[j]=a[j-1];} + + } + + } + cout<<"Your rotated array is=\t"; + for(int i=0;i