Added: 2 years ago
From: lcc0612
Views: 14,483
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (26)

Sign In or Sign Up now to post a comment!
  • Cool way of presentation :)

  • @subhadeep9874

    Cheers! Glad it worked for you!

  • great video, but no have spanish subtitles :(

  • FAST - explain a little slower - but over all really nice video!

  • @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 =)

  • What kind of Desktop Recorder are you using?

    Thank you :))

    and your tutorials are great! :P

  • @chesterr400

    Hello! Thanks for your comment. I use CamStudio for desktop recording.

  • 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

    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

    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.

  • hey thanks for video, god bless u :D

  • 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

    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?

  • @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.

  • 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

    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)

  • 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.

  • good stuff, took my teacher 2 hours...

  • 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

    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.

  • @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! :)

  • yes, it's useful ;)

  • One of the best sorting algorithm video.

    Thumbs up!!

  • @sylversphere

    Thank you very much! I'm glad you found this useful!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more