F. The UWS Algorithms

Description

This UWS - called Algorithms - proposes three different kinds of job: Chvatal, Syracuse and Ackerman. They correspond to (famous) algorithms which may take a long time in function of their parameters. Thus you will be able to play with the execution queue management and, in some cases, with the UWS errors (particularly the StackOverflowError with some parameters of Ackerman).

Besides, contrary to the UWS Timers, this UWS has been a little customized:

Additional UWS Action:

This UWS has an additional action which lets displaying a description and some statistics about this UWS.

Jobs lists

Chvatal

This algorithm must reorder an array of integer. Its values are function of its size: size=4 => {1,2,3,4}, size=7 => {1,2,3,4,5,6,7}, ... By default, these values are mixed. The algorithm must permute the array[i] first values until array[i] = i+1.
This algorithm is based on the algorithm of V. Chvatal:
while(array[1] != 1)
	// permute the first array[1] values
					

Add a new Job:

  • Array size:
  • Run now

Syracuse

Implementation of the algorithm of Syracuse also known as the problem of 3x+1. There, is the algorithm:
if (n==1)
	return 1;
else{
	if (n%2 == 0)
		return S(n/2);
	else
		return S(3n+1);
}
					

Add a new Job:

  • N =
  • Run now

Ackerman

It is a double recursive function whose the algorithm is:
if (m==0)
	return n+1;
else{
	if (n==0)
		return A(m-1, 1);
	else
		return A(m-1, A(m, n-1)); 
}
					

Add a new Job:

  • M =
  • N =
  • Run now