bubbleSort.js
/**
* Creates a list of randomly-generated integers.
* For each array element, i, 0 < i < 100
* @param {Number} N 10 < integer < 100
* @return {Array} list of N random integers
*/
Creates a list of randomly-generated integers.
For each array element, i, 0 < i < 100
Creates a list of randomly - generated integers . For each array element i 0 < i < 100
function createIntegerArray(N) {
	if (typeof N != "number") N = 50;
	else if ((N < 10) || (N > 100)) N = 50;
	else N = parseInt(N);
	var A = [];
	for (var i = 0; i < N; i++) {
		var element_i = parseInt((Math.random() * 100));
		A.push(element_i);
	}
	return A;
}
function createIntegerArray ( N ) { if ( typeof N != "number" ) N = 50 ; else if ( ( N < 10 ) || ( N > 100 ) ) N = 50 ; else N = parseInt ( N ) ; var A = [ ] ; for ( var i = 0 ; i < N ; i ++ ) { var element_i = parseInt ( ( Math . random ( ) * 100 ) ) ; A . push ( element_i ) ; } return A ; }
Creates a list of randomly-generated integers.
Creates a list of randomly - generated integers .
// Sanitize the input, N. // Create an empty array, A. // Populate A with N "random" integers. /**
		* Math.random() is a built-in JavaScript function
		* that returns a "random" number in the range [0,1),
		* i.e. 0 at a minumum but never exceeding 1.
		*/ // Return the array to the function caller.