wu :: forums
« wu :: forums - Order of Bucket Sort »

Welcome, Guest. Please Login or Register.
May 14th, 2024, 9:36pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: Eigenray, SMQ, Icarus, william wu, ThudnBlunder, Grimbal, towr)
   Order of Bucket Sort
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Order of Bucket Sort  (Read 592 times)
nks
Junior Member
**





   
Email

Gender: male
Posts: 145
Order of Bucket Sort  
« on: Jan 26th, 2009, 10:53pm »
Quote Quote Modify Modify

How the order of bucket sort is O(N+n)?
 
As it has to sort the element in every bucket is O(Nlog(N)).
 
 
 
 
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Order of Bucket Sort  
« Reply #1 on: Jan 27th, 2009, 2:42am »
Quote Quote Modify Modify

on Jan 26th, 2009, 10:53pm, nks wrote:
How the order of bucket sort is O(N+n)?
 
As it has to sort the element in every bucket is O(Nlog(N)).
But the number of buckets depends on N, the base of the logarithm is N (rather than the usual 2), so you get O(N logN N) = O(n)
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
nks
Junior Member
**





   
Email

Gender: male
Posts: 145
Re: Order of Bucket Sort  
« Reply #2 on: Jan 28th, 2009, 2:14am »
Quote Quote Modify Modify

Quote:
number of buckets depends on N

 
That's correct .
 
It is like  
 
Here n1+n2+n3+.. = N
 
so  
 n1log n1 +n1log n1 +..~= N  ( it will approach  to N)
 
IP Logged
nks
Junior Member
**





   
Email

Gender: male
Posts: 145
Re: Order of Bucket Sort  
« Reply #3 on: Jan 28th, 2009, 2:15am »
Quote Quote Modify Modify

Corrected !
 
n1log n1 +n2log n2 +..~= N  ( it will approach  to N)  
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board