Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is cardinality sorting

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

What is cardinality sorting? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Cardinal sorting is a generalization of bucket sorting, and the records it considers contain more than one keyword; cardinal sorting belongs to "distributive sorting", which assigns the sorted elements to some "buckets" through part of the information of key values. in order to achieve the role of sorting, cardinality sorting is a stable sort.

Cardinality sort

Cardinal sorting is a generalization of bucket sorting, which considers that the waiting records contain more than one keyword.

Brief introduction:

Cardinality sorting (radix sort) belongs to "distributive sorting" (distribution sort), also known as "bucket sort" or bin sort. As the name implies, it assigns the sorted elements to some "buckets" through part of the information of key values in order to achieve the function of sorting. Cardinal sorting belongs to stable sorting, and its time complexity is O (nlog (r) m), where r is the cardinality adopted and m is the heap number. In some times, the cardinality sorting method is more efficient than other stable sorting methods.

Realization method

The highest bit first (Most Significant Digit first) method, referred to as MSD method: first sort and group according to K1, record in the same group, the key K1 is equal, then sort each group into subgroups according to K2, and then continue the sorting and grouping of the following keys until the subgroups are sorted according to the least bit key kd. Then connect the groups together to get an ordered sequence.

Lowest bit first (Least Significant Digit first) method, referred to as LSD method: first sort from kd, and then sort kd-1, repeat in turn, until K1 is sorted to get an ordered sequence.

This is the end of the answer to the cardinality ranking question. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report