Simple Sorting Methods

版本 1.1.0.0 (30.4 KB) 作者: Reza Ahmadzadeh
This submission includes four sorting algorithms and a test demo.
269.0 次下载
更新时间 2015/7/13

查看许可证

This submission includes four sorting algorithms and a test demo. The algorithms include, Bubble Sorting Algorithm, Cocktail Sorting Algorithm, Insertion Sort Algorithm, and Odd-Even Sorting Algorithm. These algorithms receive a vector and sort the elements of the vector and return it in an output vector.
For Example for using the bubble sort algorithm, you can do as follows:
>> A = rand(1,100) % a vector including 100 random variables
>> SortedA1 = bubbleSort(A);
To understand the algorithms you can google them and check for instance the upcoming wikipedia pages.
To test all the algorithms at once you can run the demo

>> testSorting

引用格式

Reza Ahmadzadeh (2026). Simple Sorting Methods (https://ww2.mathworks.cn/matlabcentral/fileexchange/52077-simple-sorting-methods), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Shifting and Sorting Matrices 的更多信息
版本 已发布 发行说明
1.1.0.0

Added a new sort algorithm

1.0.0.0

Added a snapshot