Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is partitioning easier than sorting?

Tags:

People also ask

What is partitioning?

What is partitioning? Partitioning is a way of splitting numbers into smaller parts to make them easier to work with. Partitioning links closely to place value: a child will be taught to recognise that the number 54 represents 5 tens and 4 ones, which shows how the number can be partitioned into 50 and 4.

What is a partition in quick sort?

Quicksort partitions an array and then calls itself recursively twice to sort the two resulting subarrays. This algorithm is quite efficient for large-sized data sets as its average and worst-case complexity are O(n2), respectively.

What is range partitioning sort?

The range partitioner guarantees that all records with the same key field values are in the same partition and it creates partitions that are approximately equal in size so that all processing nodes perform an equal amount of work when performing the sort.


This is a question that's been lingering in my mind for some time ...

Suppose I have a list of items and an equivalence relation on them, and comparing two items takes constant time. I want to return a partition of the items, e.g. a list of linked lists, each containing all equivalent items.

One way of doing this is to extend the equivalence to an ordering on the items and order them (with a sorting algorithm); then all equivalent items will be adjacent.

But can it be done more efficiently than with sorting? Is the time complexity of this problem lower than that of sorting? If not, why not?