/    Sign up×
Community /Pin to ProfileBookmark

Hello,

Does anyone know what the most efficient sorting algorithm would be for a large array (possibly a very large array)? I am currently using the bubble sort algorithm for testing, but the array I am using is very small.

Thanks for the assistance,
lugos

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Sep 14.2005 — Are we talking 1D or multiple?

You also try the plain old myArray.sort(); and test its speed?

Eric
Copy linkTweet thisAlerts:
@lugosauthorSep 14.2005 — It is a 1 dimensional array of [I]constructor functions[/I] (what would be considered beans in Java, but without the setters and getters). So, I don't know if I could use the sort() function with that type of array. I'll go ahead and give it a shot. Thanks.

Sammy
Copy linkTweet thisAlerts:
@lugosauthorSep 14.2005 — Alright, I tried the sort() function but all it does is reverse the order of the elements.
Copy linkTweet thisAlerts:
@felgallSep 14.2005 — What type of elements are they? You may need to define a function that tells the sort how to compare two entries. I have several examples of how to do this on my page http://javascript.about.com/od/arrays/
×

Success!

Help @lugos spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...