MCPcopy Create free account
hub / github.com/chaharnishant11/CodeIn10DSA / reverse

Method reverse

C++/Code/rotateArray.cpp:14–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12class Solution{
13 public:
14 void reverse(int arr[], int start,int end){
15 while(start<end){
16 int temp = arr[start];
17 arr[start] = arr[end];
18 arr[end] = temp;
19 start++;
20 end--;
21 }
22 }
23 //Function to rotate an array by d elements in counter-clockwise direction.
24 void rotateArr(int arr[], int d, int n){
25

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected