Introduction to Algorithms by CLRS, 3rd Edition

Chapter 2
Implementation of Insertion Sort algorithm described in chapter 2 using JavaScript:

var nums = [ 31, 41, 59, 26, 41, 58 ];
for ( i = 1; i 0 && nums[ j ] > key ) {
nums[ j + 1 ] = nums[ j ];
j = j - 1;
}
nums[ j + 1 ] = key;
}

sortedArray = " ";
for ( k = 0; k < nums.length; k++ ) {
sortedArray += nums[ k ];
sortedArray += " ";
}

alert( sortedArray );

Chapter 4
– Fibonacci Series grows exponentially.
– Strassen’s Recursive algorithm is asymptotically better than the simple Square-Matrix-Multiply procedure.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s