Bits and Radix Sort Here's a Slightly More Detailed Explanation of the Running Time of Radix Sort

Total Page:16

File Type:pdf, Size:1020Kb

Bits and Radix Sort Here's a Slightly More Detailed Explanation of the Running Time of Radix Sort Bits and Radix Sort Here's a slightly more detailed explanation of the running time of radix sort. Computers internally represent numbers in base 2, i.e. as bits. Suppose you are sorting numeric keys, each having length b = 16 bits. In binary, they might look like this: 1011000011101001 0001111001101010 1110010100010000 How many dierent keys are possible? 16-bit numbers can represent 2^16 = 65,536 distinct values. We could create 65,536 buckets and sort the keys with bucket sort or counting sort. But if we're only sorting 1,000 keys or so, the cost of our algorithm is dominated by managing empty buckets. The idea of radix sort is to do multiple passes of bucket or counting sort. During each pass, we examine just a few bits of each key. Suppose we decide to examine d = 3 bits of each key per pass. Then we break each key into digits of 3 bits each: 1j011j000j011j101j001 0j001j111j001j101j010 1j110j010j100j010j000 Now, we do 6 passes of bucket/csounting sort, processing the digits from right (least signicant) to left (most signicant). There's no way we can do one-third of a pass, so the leftmost bit requires a pass all for itself. How many buckets do we need? We need one bucket for each possible "digit", i.e. combination of 3 bits. Decimal Binary 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 1 If we scan 3 bits each pass, we need 23 = 8 buckets, one for each possible digit. More generally, if we scan d bits per pass, we need: q = 2d buckets Therefore, if we have q buckets, the number of bits we scan in one pass is: bits d = log2 q and the number of passes we have to do is: d = log2 q b b = d log2 q But not really, because we can't do a fractional pass; we need to round up to the nearest integer and do b b = passes. d log2 q Each pass of bucket/counting sort takes O(n + q) time, so the running time of radix sort is in: b b (n + q) O (n + q) = O n + q + log2 q log2 q The ceiling is never less than one, and never adds more than one pass, so we get the second expression. It would be stupid to have way more buckets than items to sort, so make sure that q ≤ 10n or so. Then the running time simplies to: bn O n + log2q On the other hand, we don't want to have too many passes, so we shouldn't make too small. The best way to choose is to experiment with an implemen- q q p tation of radix sort, and try dierent values of q, roughly in the range from n to 2n. We denitely want q to be of the form 2i where i is an integer, because computers can extract base-2i digits (i.e. groups of bits, illustrated above) much faster than they can extract digits of other bases. p p Note that , so if we choose , we only do twice as log2 n = 0:5 log2 n q = n many passes as if we choose q = n. So if memory is at an absolute premium, we can reduce the number of buckets sharply by doubling the run time. Running Time Problems Note, these are pretty hard problems. Come to oce hours if you have questions. 2 1. Amortized Analysis: Given an array of length n, rigorously show that to add n additional elements, including the costs involved in doubling the size of the array, the total cost is still O(n). 2. Amortized Analysis: Say you have a table of size N, which is some unimag- inably huge number. This table has two operations, insert, and clear. Insert is constant time, and inserts some element into the table. Clear takes time proportional to the number of elements currently in the table. Given a sequence of some mix of insertions and clears in whatever order summing up to n total calls, how long does it take? 3. You are designing a game-tree search searching 3-ply, where at each move, there are always exactly 3 possible moves. (a) What is the running time of minimax game-tree search, giving a branching factor of 3, and no alpha-beta pruning? (b) Assume that your alpha-beta pruning algorithm involves a killer move heurisitic, such that you are always pruning as much of the tree as possible. i. How many nodes are being pruned? How many nodes do you end up exploring? ii. (challenge) What is the running time, given depth d? 4. You have a set of x elements. Find the running time for the following operations. (a) Create a minheap for all of them. (b) Remove the min, y times and insert into a queue. (c) Remove each element from the queue and insert each element into a normal binary search tree. (d) How long does it take overall? 5. You have a set of x elements, each of which is 32 bits or less. Analyze the following running times. They are done in order. (a) Sort them in increasing order using MergeSort, and save the result as an array. (b) Sort the sorted array again with Insertion Sort. (c) We insert all of the elements one at a time from the front to end of the array into a minHeap. How long does this take? We are not using bottom-up heapify. (Surprisingly, not x lg x) 6. You have a tree of n elements. Each of the nodes is an integer, with range [1; n] and all of them are unique. Each node has a list of its children. Your job is to sort each list of children, so they are each in increasing order, so 3 that each parent sees a list in ascending order. Each node has its own list of children, and they don't aect one another, so I only care that each list is sorted. (a) Analyze the runtime using MergeSort at every node to sort its chil- dren. (b) George proposes that instead of using a comparison sort, we should use a linear sort like bucketsort. He claims that by using n buckets at every group of siblings, the sort is linear to the number of siblings, s, and that the sum of all of this is simply n, since there are a total of n integers in the tree. This is because the numbers range from 1 to n, and regardless of what the tree looks like, there will be at most 1 thing in each bucket. Is he brilliant or...not so much? 4.
Recommended publications
  • Radix Sort Comparison Sort Runtime of O(N*Log(N)) Is Optimal
    Radix Sort Comparison sort runtime of O(n*log(n)) is optimal • The problem of sorting cannot be solved using comparisons with less than n*log(n) time complexity • See Proposition I in Chapter 2.2 of the text How can we sort without comparison? • Consider the following approach: • Look at the least-significant digit • Group numbers with the same digit • Maintain relative order • Place groups back in array together • I.e., all the 0’s, all the 1’s, all the 2’s, etc. • Repeat for increasingly significant digits The characteristics of Radix sort • Least significant digit (LSD) Radix sort • a fast stable sorting algorithm • begins at the least significant digit (e.g. the rightmost digit) • proceeds to the most significant digit (e.g. the leftmost digit) • lexicographic orderings Generally Speaking • 1. Take the least significant digit (or group of bits) of each key • 2. Group the keys based on that digit, but otherwise keep the original order of keys. • This is what makes the LSD radix sort a stable sort. • 3. Repeat the grouping process with each more significant digit Generally Speaking public static void sort(String [] a, int W) { int N = a.length; int R = 256; String [] aux = new String[N]; for (int d = W - 1; d >= 0; --d) { aux = sorted array a by the dth character a = aux } } A Radix sort example A Radix sort example A Radix sort example • Problem: How to ? • Group the keys based on that digit, • but otherwise keep the original order of keys. Key-indexed counting • 1. Take the least significant digit (or group of bits) of each key • 2.
    [Show full text]
  • Lecture 8.Key
    CSC 391/691: GPU Programming Fall 2015 Parallel Sorting Algorithms Copyright © 2015 Samuel S. Cho Sorting Algorithms Review 2 • Bubble Sort: O(n ) 2 • Insertion Sort: O(n ) • Quick Sort: O(n log n) • Heap Sort: O(n log n) • Merge Sort: O(n log n) • The best we can expect from a sequential sorting algorithm using p processors (if distributed evenly among the n elements to be sorted) is O(n log n) / p ~ O(log n). Compare and Exchange Sorting Algorithms • Form the basis of several, if not most, classical sequential sorting algorithms. • Two numbers, say A and B, are compared between P0 and P1. P0 P1 A B MIN MAX Bubble Sort • Generic example of a “bad” sorting 0 1 2 3 4 5 algorithm. start: 1 3 8 0 6 5 0 1 2 3 4 5 Algorithm: • after pass 1: 1 3 0 6 5 8 • Compare neighboring elements. • Swap if neighbor is out of order. 0 1 2 3 4 5 • Two nested loops. after pass 2: 1 0 3 5 6 8 • Stop when a whole pass 0 1 2 3 4 5 completes without any swaps. after pass 3: 0 1 3 5 6 8 0 1 2 3 4 5 • Performance: 2 after pass 4: 0 1 3 5 6 8 Worst: O(n ) • 2 • Average: O(n ) fin. • Best: O(n) "The bubble sort seems to have nothing to recommend it, except a catchy name and the fact that it leads to some interesting theoretical problems." - Donald Knuth, The Art of Computer Programming Odd-Even Transposition Sort (also Brick Sort) • Simple sorting algorithm that was introduced in 1972 by Nico Habermann who originally developed it for parallel architectures (“Parallel Neighbor-Sort”).
    [Show full text]
  • Tutorial 2: Heapsort, Quicksort, Counting Sort, Radix Sort
    Tutorial 2: Heapsort, Quicksort, Counting Sort, Radix Sort Mayank Saksena September 20, 2006 1 Heapsort We review Heapsort, and prove some loop invariants for it. For further information, see Chapter 6 of Introduction to Algorithms. HEAPSORT(A) 1 BUILD-MAX-HEAP(A) Ð eÒg Øh A 2 for i = ( ) downto 2 A i 3 swap A[1] and [ ] ×iÞ e A heaÔ ×iÞ e A 4 heaÔ- ( )= - ( ) 1 5 MAX-HEAPIFY(A; 1) BUILD-MAX-HEAP(A) ×iÞ e A Ð eÒg Øh A 1 heaÔ- ( )= ( ) Ð eÒg Øh A = 2 for i = ( ) 2 downto 1 3 MAX-HEAPIFY(A; i) MAX-HEAPIFY(A; i) i 1 Ð =LEFT( ) i 2 Ö =RIGHT( ) heaÔ ×iÞ e A A Ð > A i Ð aÖ g e×Ø Ð 3 if Ð - ( ) and ( ) ( ) then = i 4 else Ð aÖ g e×Ø = heaÔ ×iÞ e A A Ö > A Ð aÖ g e×Ø Ð aÖ g e×Ø Ö 5 if Ö - ( ) and ( ) ( ) then = i 6 if Ð aÖ g e×Ø = i A Ð aÖ g e×Ø 7 swap A[ ] and [ ] 8 MAX-HEAPIFY(A; Ð aÖ g e×Ø) 1 Loop invariants First, assume that MAX-HEAPIFY(A; i) is correct, i.e., that it makes the subtree with A root i a max-heap. Under this assumption, we prove that BUILD-MAX-HEAP( ) is correct, i.e., that it makes A a max-heap. A We show: at the start of iteration i of the for-loop of BUILD-MAX-HEAP( ) (line ; i ;:::;Ò 2), each of the nodes i +1 +2 is the root of a max-heap.
    [Show full text]
  • Sorting Algorithm 1 Sorting Algorithm
    Sorting algorithm 1 Sorting algorithm In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) that require sorted lists to work correctly; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions: 1. The output is in nondecreasing order (each element is no smaller than the previous element according to the desired total order); 2. The output is a permutation, or reordering, of the input. Since the dawn of computing, the sorting problem has attracted a great deal of research, perhaps due to the complexity of solving it efficiently despite its simple, familiar statement. For example, bubble sort was analyzed as early as 1956.[1] Although many consider it a solved problem, useful new sorting algorithms are still being invented (for example, library sort was first published in 2004). Sorting algorithms are prevalent in introductory computer science classes, where the abundance of algorithms for the problem provides a gentle introduction to a variety of core algorithm concepts, such as big O notation, divide and conquer algorithms, data structures, randomized algorithms, best, worst and average case analysis, time-space tradeoffs, and lower bounds. Classification Sorting algorithms used in computer science are often classified by: • Computational complexity (worst, average and best behaviour) of element comparisons in terms of the size of the list . For typical sorting algorithms good behavior is and bad behavior is .
    [Show full text]
  • Sorting Algorithm 1 Sorting Algorithm
    Sorting algorithm 1 Sorting algorithm A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) which require input data to be in sorted lists; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions: 1. The output is in nondecreasing order (each element is no smaller than the previous element according to the desired total order); 2. The output is a permutation (reordering) of the input. Since the dawn of computing, the sorting problem has attracted a great deal of research, perhaps due to the complexity of solving it efficiently despite its simple, familiar statement. For example, bubble sort was analyzed as early as 1956.[1] Although many consider it a solved problem, useful new sorting algorithms are still being invented (for example, library sort was first published in 2006). Sorting algorithms are prevalent in introductory computer science classes, where the abundance of algorithms for the problem provides a gentle introduction to a variety of core algorithm concepts, such as big O notation, divide and conquer algorithms, data structures, randomized algorithms, best, worst and average case analysis, time-space tradeoffs, and upper and lower bounds. Classification Sorting algorithms are often classified by: • Computational complexity (worst, average and best behavior) of element comparisons in terms of the size of the list (n). For typical serial sorting algorithms good behavior is O(n log n), with parallel sort in O(log2 n), and bad behavior is O(n2).
    [Show full text]
  • Parallel Sorting on Multi-Core Architecture
    Parallel Sorting on Multi-core Architecture A thesis submitted in partial fulfillment of the requirements for the degree of Master of Science By Wei Wang B.S., Zhengzhou University, 2007 2011 Wright State University WRIGHT STATE UNIVERSITY SCHOOL OF GRADUATE STUDIES August 19, 2011 I HEREBY RECOMMEND THAT THE THESIS PREPARED UNDER MY SUPER- VISION BY Wei Wang ENTITLED Parallel Sorting on Multi-core Architecture BE ACCEPTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF Master of Science. Meilin Liu, Ph. D. Thesis Director Mateen Rizki, Ph.D. Department Chair Committee on Final Examination Meilin Liu, Ph. D. Jack Jean, Ph. D. T.K. Prasad, Ph. D. Andrew Hsu, Ph. D. Dean, School of Graduate Studies Copyright c 2011 Wei Wang All Rights Reserved ABSTRACT Wang, Wei. M.S. Department of Computer Science and Engineering, Wright State University, 2011. Parallel Sorting on Multi-Core Architecture. With the limitations given by the power consumption (power wall), memory wall and the instruction level parallelism, the computing industry has turned its direc- tion to multi-core architectures. Nowadays, the multi-core and many-core architectures are becoming the trend of the processor design. But how to exploit these architectures is the primary challenge for the research community. To take advantage of the multi- core architectures, the software design has undergone fundamental changes. Sorting is a fundamental, important problem in computer science. It is utilized in many applications such as databases and search engines. In this thesis, we will in- vestigate and auto-tune two parallel sorting algorithms, i.e., radix sort and sample sort on two parallel architectures, the many-core nVIDIA CUDA enabled graphics proces- sors, and the multi-core Cell Broadband Engine.
    [Show full text]
  • Comparison of Parallel Sorting Algorithms
    Comparison of parallel sorting algorithms Darko Božidar and Tomaž Dobravec Faculty of Computer and Information Science, University of Ljubljana, Slovenia Technical report November 2015 TABLE OF CONTENTS 1. INTRODUCTION .................................................................................................... 3 2. THE ALGORITHMS ................................................................................................ 3 2.1 BITONIC SORT ........................................................................................................................ 3 2.2 MULTISTEP BITONIC SORT ................................................................................................. 3 2.3 IBR BITONIC SORT ................................................................................................................ 3 2.4 MERGE SORT .......................................................................................................................... 4 2.5 QUICKSORT ............................................................................................................................ 4 2.6 RADIX SORT ........................................................................................................................... 4 2.7 SAMPLE SORT ........................................................................................................................ 4 3. TESTING ENVIRONMENT .................................................................................... 5 4. RESULTS ................................................................................................................
    [Show full text]
  • Discussion 10 Solution Fall 2015 1 Sorting I Show the Steps Taken by Each Sort on the Following Unordered List
    CS 61B Discussion 10 Solution Fall 2015 1 Sorting I Show the steps taken by each sort on the following unordered list: 106, 351, 214, 873, 615, 172, 333, 564 (a) Quicksort (assume the pivot is always the first item in the sublist being sorted and the array is sorted in place). At every step circle everything that will be a pivot on the next step and box all previous pivots. 106 351 214 873 615 172 333 564 £ 106 351 214 873 615 172 333 564 ¢ ¡ £ 106 214 172 333 351 873 615 564 £¢ ¡ £ 106 172 214 333 351 615 564 873 ¢ ¡ £¢ ¡ 106 172 214 333 351 564 615 873 ¢ ¡ (b) Merge sort. Show the intermediate merging steps. 106 351 214 873 615 172 333 564 106 351 214 873 172 615 333 564 106 214 351 873 172 333 564 615 106 214 351 873 172 333 564 615 106 172 214 333 351 564 615 873 (c) LSD radix sort. 106 351 214 873 615 172 333 564 351 172 873 333 214 564 615 106 106 214 615 333 351 564 172 873 106 172 214 333 351 564 615 873 2 Sorting II Match the sorting algorithms to the sequences, each of which represents several intermediate steps in the sorting of an array of integers. Algorithms: Quicksort, merge sort, heapsort, MSD radix sort, insertion sort. CS 61B, Fall 2015, Discussion 10 Solution 1 (a) 12, 7, 8, 4, 10, 2, 5, 34, 14 7, 8, 4, 10, 2, 5, 12, 34, 14 4, 2, 5, 7, 8, 10, 12, 14, 34 Quicksort (b) 23, 45, 12, 4, 65, 34, 20, 43 12, 23, 45, 4, 65, 34, 20, 43 Insertion sort (c) 12, 32, 14, 11, 17, 38, 23, 34 12, 14, 11, 17, 23, 32, 38, 34 MSD radix sort (d) 45, 23, 5, 65, 34, 3, 76, 25 23, 45, 5, 65, 3, 34, 25, 76 5, 23, 45, 65, 3, 25, 34, 76 Merge sort (e) 23, 44, 12, 11, 54, 33, 1, 41 54, 44, 33, 41, 23, 12, 1, 11 44, 41, 33, 11, 23, 12, 1, 54 Heap sort 3 Runtimes Fill in the best and worst case runtimes of the following sorting algorithms with respect to n, the length of the list being sorted, along with when that runtime would occur.
    [Show full text]
  • A Comparative Study of Sorting Algorithms Comb, Cocktail and Counting Sorting
    International Research Journal of Engineering and Technology (IRJET) e‐ISSN: 2395 ‐0056 Volume: 04 Issue: 01 | Jan ‐2017 www.irjet.net p‐ISSN: 2395‐0072 A comparative Study of Sorting Algorithms Comb, Cocktail and Counting Sorting Ahmad H. Elkahlout1, Ashraf Y. A. Maghari2. 1 Faculty of Information Technology, Islamic University of Gaza ‐ Palestine 2 Faculty of Information Technology, Islamic University of Gaza ‐ Palestine ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐***‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ Abstract –The sorting algorithms problem is probably one java programming language, in which every algorithm sort of the most famous problems that used in abroad variety of the same set of random numeric data. Then the execution time during the sorting process is measured for each application. There are many techniques to solve the sorting algorithm. problem. In this paper, we conduct a comparative study to evaluate the performance of three algorithms; comb, cocktail The rest part of this paper is organized as follows. Section 2 and count sorting algorithms in terms of execution time. Java gives a background of the three algorithms; comb, count, and programing is used to implement the algorithms using cocktail algorithms. In section 3, related work is presented. numeric data on the same platform conditions. Among the Section4 comparison between the algorithms; section 5 three algorithms, we found out that the cocktail algorithm has discusses the results obtained from the evaluation of sorting the shortest execution time; while counting sort comes in the techniques considered. The paper is concluded in section 6. second order. Furthermore, Comb comes in the last order in term of execution time. Future effort will investigate the 2.
    [Show full text]
  • Register Level Sort Algorithm on Multi-Core SIMD Processors
    Register Level Sort Algorithm on Multi-Core SIMD Processors Tian Xiaochen, Kamil Rocki and Reiji Suda Graduate School of Information Science and Technology The University of Tokyo & CREST, JST {xchen, kamil.rocki, reiji}@is.s.u-tokyo.ac.jp ABSTRACT simultaneously. GPU employs a similar architecture: single- State-of-the-art hardware increasingly utilizes SIMD paral- instruction-multiple-threads(SIMT). On K20, each SMX has lelism, where multiple processing elements execute the same 192 CUDA cores which act as individual threads. Even a instruction on multiple data points simultaneously. How- desktop type multi-core x86 platform such as i7 Haswell ever, irregular and data intensive algorithms are not well CPU family supports AVX2 instruction set (256 bits). De- suited for such architectures. Due to their importance, it veloping algorithms that support multi-core SIMD architec- is crucial to obtain efficient implementations. One example ture is the precondition to unleash the performance of these of such a task is sort, a fundamental problem in computer processors. Without exploiting this kind of parallelism, only science. In this paper we analyze distinct memory accessing a small fraction of computational power can be utilized. models and propose two methods to employ highly efficient Parallel sort as well as sort in general is fundamental and bitonic merge sort using SIMD instructions as register level well studied problem in computer science. Algorithms such sort. We achieve nearly 270x speedup (525M integers/s) on as Bitonic-Merge Sort or Odd Even Merge Sort are widely a 4M integer set using Xeon Phi coprocessor, where SIMD used in practice.
    [Show full text]
  • Different Sorting Algorithm's Comparison Based Upon the Time
    International Journal of u- and e- Service, Science and Technology Vol.9, No. 8 (2016), pp.287-296 http://dx.doi.org/10.14257/ijunesst.2016.9.8.24 Different Sorting Algorithm’s Comparison based Upon the Time Complexity D. Rajagopal1* and K. Thilakavalli2 1Assistant Professor, Department of Computer Applications, KSR College of Arts and Science(Autonomous), Tiruchengode, Namakkal Dt, Tamilnadu, India 2Assistant Professor, Department of Computer Applications, KSR College of Arts and Science(Autonomous), Tiruchengode, Namakkal Dt, Tamilnadu, India [email protected],[email protected] Abstract In this paper the different sorting algorithms execution time has been examined with different number of elements. Through this experimental result concluded that the algorithm which is working best. The analysis, execution time has analyzed, tabulated in Microsoft Excel. The sorting problem has attracted a great deal of study, possibly due to the complexity of solving it proficiently despite its simple, familiar statement. Sorting algorithms are established in opening computer science classes, where the abundance of algorithms for the problem provides a gentle beginning to variety of core algorithm concepts. Objective of this paper is finding the best sorting algorithm. Keywords: Sorting algorithm, Time Complexity, Efficiency, Execution Time, Quick Sort, Selection Sort 1. Introduction Sorting algorithm is an algorithm in that the most-used orders are numerical order and lexicographical order in computer science and mathematics. Proficient sorting is vital for optimizing the utilization of other algorithms that require sorted lists to work correctly. More properly, the output must gratify two circumstances: (1) The output is in non decreasing order and (2) The output is a variation, or reordering, of the input.
    [Show full text]
  • 7 Internal Sorting and Quicksort) by Taking Advantage of the Best Case Behavior of Another Algorithm (Insertion Sort)
    7 Internal Sorting We sort many things in our everyday lives: A handful of cards when playing Bridge; bills and other piles of paper; jars of spices; and so on. And we have many intuitive strategies that we can use to do the sorting, depending on how many objects we have to sort and how hard they are to move around. Sorting is also one of the most frequently performed computing tasks. We might sort the records in a database so that we can search the collection efficiently. We might sort the records by zip code so that we can print and mail them more cheaply. We might use sorting as an intrinsic part of an algorithm to solve some other problem, such as when computing the minimum-cost spanning tree (see Section 11.5). Because sorting is so important, naturally it has been studied intensively and many algorithms have been devised. Some of these algorithms are straightforward adaptations of schemes we use in everyday life. Others are totally alien to how hu- mans do things, having been invented to sort thousands or even millions of records stored on the computer. After years of study, there are still unsolved problems related to sorting. New algorithms are still being developed and refined for special- purpose applications. While introducing this central problem in computer science, this chapter has a secondary purpose of illustrating many important issues in algorithm design and analysis. The collection of sorting algorithms presented will illustate that divide- and-conquer is a powerful approach to solving a problem, and that there are multi- ple ways to do the dividing.
    [Show full text]