Sorting an Array Using Combsort
page 1 of 2
Published: 02 Nov 2003
Unedited - Community Contributed
Abstract
Using Combsort in VBScript to sort an array, with performance analysis.
by Niels Martin Hansen
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 23271/ 33
Article Contents:

Introduction

The other day I had to sort a rather large array. I could have used the wellknown quicksort-method, but then I remembered the combsort-method. (Unfortunately I can not remember, who has made this exellent sorting algorithm). Combsorting is very simple to implement and it is comparable in speed to quicksort, but is is not known by very many programmers.

Below is a VBscript-program where you can compare combsort to bobblesort. On my Thinkpad 570 I got the folowing results:

Number of elements to sort: Combsort Bubblesort
1000 0.25 sec 5.6 sec
1500 0.4 sec 12.0 sec
10000 3.4 sec n/a
20000 7 sec n/a
40000 17 sec n/a
60000 26 sec n/a

It is only the procedure CombSort, which is interesting. The rest is just to make it possible to measure the performance.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-04-28 12:23:05 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search