Whats the question lmaoooooooooooooooooooooo
You should really state what language you are using. I have produced your method in C#, and should be easily translatable in to any other language.
static void RotateRight<T>(T[] arr)
{
T temp = arr[arr.Length - 1];
for (int i = arr.Length - 1; i >= 0; i--)
{
if (i == 0)
arr[i] = temp;
else
arr[i] = arr[i - 1];
}
}
Answer:
Umm what? Are you talking about the type of problem it is? If so it is an optimization problem.
Explanation:
I had something like this for one of my tests and I chose the optimization problem because it finds the values of decision variables that result in a maximum or minimum of a function.
But ion know if it's this that you are talking about