Radix sort vs Counting sort vs Bucket sort. What's the difference?

前端 未结 7 1141
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 21:50

I am reading the definitions of radix, counting and bucket sorts and it seems that all of them are just the code below:

public static void sort(int[] a, int maxV         


        
7条回答
  •  失恋的感觉
    2021-01-29 21:56

    Radix sort uses a form of counting sort as subroutine (ok, can use, but most often it will be counting sort).

    Countingsort is a special form of bucket sort, as kasavbere answered.

    And Bucketsort divides the keys into buckets and then sorts the buckets individually.

提交回复
热议问题