It says that radix sort uses the divide-and-conquer technique but does not explicitly state that is is itself a divide-and-conquer algorithm. The closest call was this post Why does radix sort divides it's elements though it is not a Stable Sort?:įirst, Radix-sort divide and group because it works on divide and conquer technique. I also researched in my Algorithms and Datastructures book (Algorithmen und Datenstrukturen) but it didn't explicitly state that. Neither is it explicitly written on wikipedia, nor do some related questions provide the answer. Merge sort is defined as a sorting algorithm that works by dividing an array into smaller subarrays, sorting each subarray, and then merging the sorted subarrays back together to form the final sorted array. I already tried looking for some explicit statements that radix sort is a divide-and-conquer algorithm, but didn't find the answer. My question now is: Is the definition of divide-and-conquer satisfied? Did I even use the correct definition? If not what did I do wrong in my thought process? I think that breaking down the problem is satisfied, so should in my opinion be the solving of this problem (sorting using counting sort in O(n), as this is already the most simple solution) but I am not sure about the combining step. Next I have to sort each bucket (starting with the least significant digit and working to the most significant) with for e.g. Merge sort algorithm sorts a list or array using a divide and conquer strategy. As far as I understand in this case I first split my problem into 3 buckets, where each bucket is assigned to least significant digit, the middle one and the most significant digit. I have only one question, about putting 2,1 as the first and last point, I have a check to make sure its not the same point repeated, because that would make it a single point and not considered as the closest pair. Lets assume we just use numbers from 0 to 999 for simplification. begingroup First, thank you for taking a part of your time to write your observations. The solutions to the sub-problems are then combined to give a solution to the original problem. I was wondering if Radix sort can clearly be defined as being a divide-and-conquer algorithm.Īs I understand a divide and conquer algorithm is defined by:Ī divide-and-conquer algorithm recursively breaks down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |