Insertion Sort MatLab Function
by Mehdi Goudarzi
21 Dec 2012
[output] is an array of number which is the sorted version of [input].
|
Watch this File
|
| File Information |
| Description |
You can simply copy and paste this function to the folder you keep your function m-files.
Insertion Sort is of n^2 order and performs well for up to 10,000 inputs.
Examples of how you can use this function include, but aren't limited to:
1.
plot(floor(100 * rand(1,100))); hold on;
plot(insertion_sort(floor(100 * rand(1,100))),'r');
2.
a = insertion_sort([1 2 3 2 1 2 3 5 4 3 2 1 4 6 8])
I would appreciate your suggestions, further examples, comments and criticisms.
Best Regards
Mehdi |
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 7.9 (R2009b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
|
Contact us