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

Function Arrange

Arrays/31_Menu_for_Array.c:445–460  ·  view source on GitHub ↗

-ve on left side and +ve on right side

Source from the content-addressed store, hash-verified

443
444//-ve on left side and +ve on right side
445void Arrange(struct array *arr)
446{
447 int i=0,j=arr->length-1;
448 while(arr->A[i]<0)
449 {
450 i++;
451 }
452 while(arr->A[j]>0)
453 {
454 j--;
455 }
456 if(i<j)
457 {
458 swap(&arr->A[i],&arr->A[j]);
459 }
460}
461
462struct array* Merge(struct array *arr,struct array *arr2)
463{

Callers 1

mainFunction · 0.85

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected