Consider the following list of names: PEVAC, MARKOV, ZLATAREVA, ABDOLLAHZADEH, CHEN, WILLIAMS, ALBAYRAM, KURKOVSKY, ZABIHIMAVAN. Use Radix sort to sort them in alphabetic order. How many passes would be made through the outer while loop? Trace the contents of the list after each of these passes.
1). ANSWER :
GIVENTHAT :
To Consider the following list of names: PEVAC, MARKOV, ZLATAREVA, ABDOLLAHZADEH, CHEN, WILLIAMS, ALBAYRAM, KURKOVSKY, ZABIHIMAVAN.
N RADIX SORT, THE NUMBER OF ITERATIONS OR PASSES IS EQUAL TO THE LENGTH OF LONGEST STRING.
HERE, THE LONGEST STRING IS 'ABDOLLAHZADEH'.
SO, THE NUMBER OF PASSES FOR OUTER WHILE LOOP IS 13.
Get Answers For Free
Most questions answered within 1 hours.