Sorabh decided to write down a list of numbers. When Sorabh finished the task, he put that list of numbers in an array:
a = [7, 1, 9, 6, 10, 5, 8, 2, 3, 4]
After that, Sorabh decided to arrange all the numbers by shifting them around, calling the function shift_numbers() with parameter t=5. What will be printed at the end?
function shift_numbers(a, t):
for j in (1, t):
x = a[1]
for i in (1, len(a)-1):
a[i] = a[i+1]
a[len(a)] = x
for i in (1, len(a)):
if i == len(a) then:
print(a[i])
else:
print(a[i], ", ")
shift_numbers(a, 5)Answer format: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Note: The pseudocode assumes 1-based indexing for arrays. In other words, array elements are referred to starting from index 1.