MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / rotate

Function rotate

CPP/array-2d/rodate_array.cpp:4–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4void rotate(int arr[],int n,int d)
5{
6 int temp[n];
7 int j=0;
8 for(int i=d;i<n;i++)
9 {
10 temp[j]=arr[i];
11 j++;
12 }
13 for(int i=0;i<d;i++)
14 {
15 temp[j]=arr[i];
16 j++;
17 }
18 for(int i=0;i<n;i++)
19 {
20 arr[i]=temp[i];
21 }
22}
23void print(int arr[ ],int n)
24{
25 for(int i=0;i<n;i++){

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected