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

Function rShift

Arrays/31_Menu_for_Array.c:355–367  ·  view source on GitHub ↗

Right Shift Function

Source from the content-addressed store, hash-verified

353
354//Right Shift Function
355void rShift(struct array *arr)
356{
357 int i;
358 for(i=arr->length-1;i>0;i--)
359 {
360 arr->A[i]=arr->A[i-1];
361 }
362 printf("\nThe elements in the array after right shift are: \n");
363 for(i=1;i<=arr->length-1;i++)
364 {
365 printf("%d ",arr->A[i]);
366 }
367}
368
369//Left Rotation Function
370void lRot(struct array *arr)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected