thus far we have been considering sorting depend


Thus far, we have been considering sorting depend on single keys. However, in real life applications, we may desire to sort the data on several keys. The simplest instance is that of sorting a deck of cards. The first key for sorting is the suit-clubs, diamonds, spades and hearts. Then, inside each of suit, sorting the cards into the ascending order from Ace, twos to king. Thus this is a case of sorting on 2 keys.

Now, it can be done in two ways.

1 •   Sort 52 cards within 4 piles according to the suit.

   •   Sort each of 4 piles according to face value of the cards.

2 •   Sort 52 cards within 13 piles according to face value.

   •   Stack these piles in order and then sort into 4 piles depend on suit.

The first method is called the as MSD (Most Significant Digit) sort & second method is called as the LSD (Least Significant Digit) sort. Digit stands for key. Although they are called as sorting methods, MSD & LSD sorts only choose the order of sorting. The sorting could be done by any of the sorting methods discussed in this unit.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: thus far we have been considering sorting depend
Reference No:- TGS0264371

Expected delivery within 24 Hours