Alan J.

asked • 04/02/21

QUESTION ON ARRAY

Given a circular array of integers, do the following operations stepwise :

Value Index

25 0

39 1

52 2

25 3

0 4

0 5

45 6

25 7

5 8

19 9

29 10

5 11

26 12


The start of the array is index 6. [Note: if the capacity of the array is full, resize it by its previous capacity + 3].


a. Remove 25 by right-shifting.

b. Insert b%67 at position 5.

c. Insert studentId%13 at position 8.

d. Insert birthyear%61 at position 3.

e. Remove 5 by left-shifting.

f. Remove 52 by left-shifting.

g. Right rotate the array 3 times.

h. Left rotate the array by 4 times.


You have to show the simulation of each operation separately, no coding is required.

NOTE: DO IT IN PYTHON ONLY.



1 Expert Answer

By:

Patrick B. answered • 04/02/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.