Hello, thanks for your comment! I've already taken note of this and (hopefully!) taken this into consideration for future videos. Glad I've been a help =)
A good tutorial, however what if the numbers weren't 1-9. How would you be able to do those 1-3, 4-6, 7-9 sorting thingy? Let's say 6,8,11,51,34,1,8,16,7?
Hello! You have a valid point there. You need to somehow know the full range of your data before you can carry out a bucket sort.
I quote an earlier post by myself...
"While I'm not sure if there are more efficient methods, you could, of course, make one pass across all the input values, and determine the maximum and minimum values, to give yourself a range for creating buckets."
I see, I didn't notice it. Well, hey my bad. Anyway, we are doing a report about this sort, well, i was wondering if you could send me an email regarding this and a more elaborated explanation if that's possible.
thats horrible,you simply dont know anything why someone wants to learn from animation.I tell you:because the teacher is also horrible,how they explain the algorithm,and finally TOO FAST!
Thank you for your comment. What do you think I can improve in my animation? Please let me know so I can produce even better content in the future! Thanks for your feedback!
wouldn't this mean that the programmer would have to know the ranges of the values presented in 'n' inputs? for example, right now you can see that you have a range of numbers from 1-9 and you divide it into 3 buckets, but if you have let's say, 1billion inputs values that are not sequenced AFTER sorted, like 1,4,7,9,20,500.. with arbitrary gaps between them, how would you set the ranges for each bucket?
Exactly! Unless you have an idea as to what your input data is like, you can't effectively carry out bucket sorting.
While I'm not sure if there are more efficient methods, you could, of course, make one pass across all the input values, and determine the maximum and minimum values, to give yourself a range for creating buckets.
Since I wrote yesterday I have been trying to perfect my effort to implement bucket sort but it all ends in a big SEGMENTATION FAULT hahaha... I'm literally going crazy here, I assumed that I know what my 'min' and 'max' are and that the function can have access to them, but still, even with a fixed number of buckets, I can't get around the math/logic part of the algorithm to successfully split things evenly into buckets. Help!
You need to define your buckets first. If you don't really know the nature of your input data, it's going to be quite a gamble. Assuming that input data is completely random and falls within a fixed range, then evenly dividing the range into an arbitrary number of buckets would suffice.
As for the remaining splitting, you'll need to create as many arrays as there are buckets. Then traverse the original (input) array. For each item, you can either use switch-case or if blocks to basically write the items to their corresponding arrays.
Hi, I've recently been issued a project where I need to compare sorting algorithms for efficiency, etc. Among them is Bucket sort, unfortunately I can't, for the life of me, find a decent implementation on the web. I was wondering if you had the implementation for it? Any language is fine and even pseudo-code would help me! Thanks anyway for the video!
Very interesting point. Do you know why there is no real implementation you can easily get? The reason is that bucket sort needs to know the boundaries of the input data before it can create buckets.
That means, I need to know that input data is, say, between 1 and 100, before I can decide that maybe I want five buckets, each covering a range of 20 items.
It IS possible to build a variable bucket sort though, so I'll give it a try.
Cool way of presentation :)
subhadeep9874 6 days ago
@subhadeep9874
Cheers! Glad it worked for you!
lcc0612 6 days ago
great video, but no have spanish subtitles :(
fopax 3 months ago
FAST - explain a little slower - but over all really nice video!
konsu89 6 months ago 2
@konsu89
Hello, thanks for your comment! I've already taken note of this and (hopefully!) taken this into consideration for future videos. Glad I've been a help =)
lcc0612 6 months ago
What kind of Desktop Recorder are you using?
Thank you :))
and your tutorials are great! :P
chesterr400 8 months ago
@chesterr400
Hello! Thanks for your comment. I use CamStudio for desktop recording.
lcc0612 8 months ago
A good tutorial, however what if the numbers weren't 1-9. How would you be able to do those 1-3, 4-6, 7-9 sorting thingy? Let's say 6,8,11,51,34,1,8,16,7?
impatrick4 10 months ago
@impatrick4
Hello! You have a valid point there. You need to somehow know the full range of your data before you can carry out a bucket sort.
I quote an earlier post by myself...
"While I'm not sure if there are more efficient methods, you could, of course, make one pass across all the input values, and determine the maximum and minimum values, to give yourself a range for creating buckets."
lcc0612 10 months ago
@lcc0612
I see, I didn't notice it. Well, hey my bad. Anyway, we are doing a report about this sort, well, i was wondering if you could send me an email regarding this and a more elaborated explanation if that's possible.
Thank you.
impatrick4 10 months ago
hey thanks for video, god bless u :D
Akshayphadke 11 months ago
thats horrible,you simply dont know anything why someone wants to learn from animation.I tell you:because the teacher is also horrible,how they explain the algorithm,and finally TOO FAST!
etibors 1 year ago
@etibors
Thank you for your comment. What do you think I can improve in my animation? Please let me know so I can produce even better content in the future! Thanks for your feedback!
lcc0612 1 year ago
wouldn't this mean that the programmer would have to know the ranges of the values presented in 'n' inputs? for example, right now you can see that you have a range of numbers from 1-9 and you divide it into 3 buckets, but if you have let's say, 1billion inputs values that are not sequenced AFTER sorted, like 1,4,7,9,20,500.. with arbitrary gaps between them, how would you set the ranges for each bucket?
kangaru90 1 year ago
@kangaru90
Exactly! Unless you have an idea as to what your input data is like, you can't effectively carry out bucket sorting.
While I'm not sure if there are more efficient methods, you could, of course, make one pass across all the input values, and determine the maximum and minimum values, to give yourself a range for creating buckets.
lcc0612 1 year ago
Since I wrote yesterday I have been trying to perfect my effort to implement bucket sort but it all ends in a big SEGMENTATION FAULT hahaha... I'm literally going crazy here, I assumed that I know what my 'min' and 'max' are and that the function can have access to them, but still, even with a fixed number of buckets, I can't get around the math/logic part of the algorithm to successfully split things evenly into buckets. Help!
alejandrosoto27 1 year ago
@alejandrosoto27
You need to define your buckets first. If you don't really know the nature of your input data, it's going to be quite a gamble. Assuming that input data is completely random and falls within a fixed range, then evenly dividing the range into an arbitrary number of buckets would suffice.
(continued)
lcc0612 1 year ago
As for the remaining splitting, you'll need to create as many arrays as there are buckets. Then traverse the original (input) array. For each item, you can either use switch-case or if blocks to basically write the items to their corresponding arrays.
lcc0612 1 year ago
good stuff, took my teacher 2 hours...
mdr1988 1 year ago
Hi, I've recently been issued a project where I need to compare sorting algorithms for efficiency, etc. Among them is Bucket sort, unfortunately I can't, for the life of me, find a decent implementation on the web. I was wondering if you had the implementation for it? Any language is fine and even pseudo-code would help me! Thanks anyway for the video!
alejandrosoto27 1 year ago
@alejandrosoto27
Very interesting point. Do you know why there is no real implementation you can easily get? The reason is that bucket sort needs to know the boundaries of the input data before it can create buckets.
That means, I need to know that input data is, say, between 1 and 100, before I can decide that maybe I want five buckets, each covering a range of 20 items.
It IS possible to build a variable bucket sort though, so I'll give it a try.
lcc0612 1 year ago
@alejandrosoto27
The Pseudocode for bucket sort is
n <-- length[ A ]
for i <-- 1 to n
do insert A[ i ] into the list B [ nA[ i ] ]
for i <-- 0 to n-1
do sort the list B[ i ] with insertion sort
merge neatly the lists B[ 1 ], B[ 2 ], . . , B[ n-1 ]
hope it will help! :)
LAJAVOPSETO 6 months ago
yes, it's useful ;)
lunacik1 1 year ago
One of the best sorting algorithm video.
Thumbs up!!
sylversphere 1 year ago
@sylversphere
Thank you very much! I'm glad you found this useful!
lcc0612 1 year ago