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

Method Rearrange

Arrays/18_Menu_Based_problem.cpp:219–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 return 1;
218}
219void Array::Rearrange()
220{
221 int i,j;
222 i=0;
223 j= length-1;
224
225 while(i<j)
226 {
227 while( A[i]<0)i++;
228 while( A[j]>=0)j--;
229 if(i<j)swap(& A[i],& A[j]);
230 }
231
232}
233Array* Array::Merge(Array arr2)
234{
235 int i,j,k;

Callers

nothing calls this directly

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected