Sorting algorithms/Bubble sort: Difference between revisions
Content added Content deleted
Line 660: | Line 660: | ||
While bubble sort is a basic algorithm it also illustrates a difference in the way Icon handles types. Built-in |
While bubble sort is a basic algorithm it also illustrates a difference in the way Icon handles types. Built-in |
||
operators for comparing data types make a syntactic distinction between numeric and string types, and sorting |
operators for comparing data types make a syntactic distinction between numeric and string types, and sorting |
||
structured and user-defined types |
structured and user-defined types require custom code. The following code |
||
allows the user to specify the type of comparison to use but handles integer |
allows the user to specify the type of comparison to use but handles integer |
||
or string lists automatically. |
or string lists automatically. |