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

Function Reverse1

Arrays/12_Rotate_and_Shift.cpp:35–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void Reverse1(struct Array* arr)
36{
37 int i, j;
38 for (i = 0, j = arr->length - 1; i < j; i++, j--) // we will interchange 1st with the last element
39 Swap(&arr->A[i], &arr->A[j]); // swapping 1st with the last
40
41}
42
43
44int main()

Callers 1

mainFunction · 0.85

Calls 1

SwapFunction · 0.85

Tested by

no test coverage detected