Sorting

There are a number of different ways you can sort an array.


Excel Sort

Excel Sort is definitely the fastest.
This transfers the array to a worksheet, sorts the array and then transfers it back to the array.


Bubble Sort

Bubble Sort uses a 'swapping' strategy to repeatedly swap the adjacent elements if they are in wrong order.
The Bubble sort is reasonably fast with small arrays but for larger arrays (> 5,000) forget it !!


Counting Sort

Counting Sort uses a 'counting' strategy to count the number of occurrences of each unique element in the array.


Quick Sort

Quick Sort uses a 'divide and conquer' strategy to divide a list into two sub-lists.
The Quick Sort is fast when the array needs a lot of sorting.
If the array is partially sorted this may not be the fastest algorithm.


Word Sort

You can use the following line to sort an array in Microsoft Word

WordBasic.SortArray (arArrayName) 

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext