Write a void method shift that takes three parameters a p d


Write a void method Shift that takes three parameters A, p, d.

A is an array, p is the number of positions and d is the direction (L = left, R = right). The method should shift the contents of A p positions in the d direction.

(B) To test your method, write a program that reads an array of 10 elements then calls Shift twice and prints the array after each call.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a void method shift that takes three parameters a p d
Reference No:- TGS01205863

Now Priced at $10 (50% Discount)

Recommended (91%)

Rated (4.3/5)