Comparison of All Sorting Algorithms Pdf

Total Page:16

File Type:pdf, Size:1020Kb

Comparison of All Sorting Algorithms Pdf Comparison of all sorting algorithms pdf Continue In this blog, we will analyze and compare different sorting algorithms based on different parameters such as time complexity, place, stability, etc. In a comparison-based sorting algorithm, we compare the elements of a table with each other to determine which of the two elements should occur first in the final sorted list. All comparison-based sorting algorithms have a lower nlogn complexity. (Think!) Here is a comparison of the complexities of time and space of some popular comparison-based sorting algorithms: there are sorting algorithms that use special information about keys and operations other than comparison to determine the sorted order of the items. Therefore, nlogn lower limit does not apply to these sorting algorithms. A sorting algorithm is in place if the algorithm does not use extra space to manipulate the input, but may require a small extra space but not a substantial one for its operation. Or we can say, a sorting algorithm sorts in place if only a constant number of input panel items are ever stored outside the table. A sorting algorithm is stable if it does not change the order of items with the same value. Online/offline: an algorithm that accepts a new element during the sorting process, this algorithm is called the online sorting algorithm. From the above sorting algorithms, the insertion sorting is online. Understanding sorting algorithms is the best way to learn problem solving and complexity analysis in algorithms. In some cases, we often use sorting as a key routine to solve several coding problems. Knowing which algorithm is the best possible depends heavily on the details of the application and implementation. In most practical situations, quicksort is a popular algorithm for sorting large input tables because its expected running time is O (nlogn). It also outperforms heap sorting in practice. If stability is important and space is available, fusion sorting may be the best choice for implementation. (Think!) Like insert sorting, quick sorting has tight code and the constant factor hidden in its running time is small. When the input table is almost sorted or the size of the input is small, insert sorting may be preferred. We may prefer merging sorting for sorting a linked list. (Think!) Happy Coding, Enjoy algorithms! Maplesoft™, eine Tochtergesellschaft der Cybernet Systems Co., Ltd. in Japan, ist ein fàhrender Lieferant von Hochleistungs-Softwarewerkzeugen for Technik, Wissenschaft und Mathematik. Hinter den Produkten steht Philosophy, dass Menschen mit gro-artigen Werkzeugen gro-artige Dinge schaffen konnen. Erfahren Sie mehr 'ber Maplesoft An algorithm that organizes lists in order This section does not cite any sources. Please help improve this section by adding quotes to reliable sources. Non-source materials can be challenged and removed. (May 2019) (Find out how and when to remove this message) In computer science, a sorting algorithm is an algorithm that puts items from a list in a certain order. The most frequently used orders are the numerical order and the lexicographic order. Effective sorting is important to optimize the effectiveness of other algorithms (such as search and fusion algorithms) that require input data into sorted lists. Sorting is also often useful for canonizing data and producing human-readable outputs. More formally, the output of any sorting algorithm must meet two conditions: the output is in non-decrepit order (each element is no smaller than the previous element in the desired total order); The output is a permutation (a reorganization, while retaining all the original elements) of the input. In addition, input data is often stored in a table, allowing random access, rather than a list, that does not allow sequential access; although many algorithms can be applied to either type of data after an appropriate change. Sorting algorithms are often called a word followed by the word sort and grammatically are used in English as name phrases, for example in the sentence, it is ineffective to use insertion sorting on large lists the sentence insertion sort refers to the insertion sorting algorithm. History Since the beginning of computing, the sorting problem has attracted a lot of research, perhaps because of the complexity of solving it effectively despite its simple and familiar statement. Among the authors of the first sorting algorithms around 1951 was Betty Holberton (née Snyder), who worked on ENIAC and UNIVAC. [1] [2] Bubble sorting was analyzed as early as 1956. [3] Comparison sorting algorithms have a fundamental requirement for comparisons Ω (n log n) (some input sequences will require a multiple of n log n comparisons, where n is the number of items in the table to be sorted). Algorithms that are not based on comparisons, such as counting sorting, may perform better. The optimal asymptotically algorithms have been known since the mid-20th century — useful new algorithms are still being invented, with the now widely used Timsort dating back to 2002, and library sorting being first published in 2006. Sorting algorithms are prevalent in introductory computing classes, where the abundance of algorithms for the problem provides a gentle introduction to a variety of basic algorithm concepts, such as big O notation, dividing and conquering algorithms, data structures such as heaps and binary trees, randomized algorithms, the best, the worst and the analysis of cases, time-space compromises, and upper and lower limits. Sorting small tables optimally (at least in comparisons and swaps) or fast (i.e. taking into account machine-specific details) remains an open search problem, with solutions known only for very small tables (20 items). Similarly, the optimal sorting (by definition various) various) machine is an open research topic. Classification sorting algorithms are often categorized by: Computer complexity (worst, average and best behavior) in terms of list size (n). For typical serial sorting algorithms, the right behavior is O(n log n), with parallel sorting in O (log2 n), and bad behavior is O(n2). (See Big O rating.) The ideal behavior for a serial sorting is O(n), but this is not possible in the average case. The optimal parallel sorting is O (log n). Comparison-based sorting algorithms must at least Ω log for most entries. Computational complexity of swaps (for n place algorithms). Use of memory (and use of other computer resources). In particular, some sorting algorithms are in place. Strictly 20/1, on-site sorting only needs O(1) memory beyond the sorted items; sometimes O (log)n) the additional memory is considered n place. Recursion. Some algorithms are recursive or non-recursive, while others may be both (e.g., type of fusion). Stability: Stable sorting algorithms maintain the relative order of records with equal keys (i.e. values). Whether or not it is some kind of comparison. A comparison sorting only examines the data by comparing two elements with a comparison operator. General method: insertion, exchange, selection, fusion, etc. Exchange types include bubble sorting and quicksort. Selection sorting includes sorting shaker and heap. Whether the algorithm is in series or in parallel. The rest of this discussion focuses almost exclusively on serial algorithms and assumes serial operation. Adaptability: The precedence of entry affects the running time or not. Algorithms that take this into account are known to be adaptive. Stability An example of stable sorting on playing cards. When the cards are sorted by row with a stable sorting, the two 5s must remain in the same order in the sorted output they were originally in. When sorted with a non-stable sort, the 5 may end up in the opposite order in the sorted output. Stable sorting algorithms sort repeated items in the same order as they appear in the input. When sorting certain types of data, only a portion of the data is examined when determining the sorting order. For example, in the right-hand card sorting example, the cards are sorted by their rank, and their costume is ignored. This allows the possibility of several different versions properly sorted from the original list. Stable sorting algorithms choose one of them, according to the following rule: if two elements compare equally, such as two 5 cards, then their relative order will be preserved, so that if one came before the other in the entrance, it will also come before the other in the exit. Stability is important for the following reason: let's say that students' files consisting of names and classrooms are sorted dynamically on a web page, first by name, then by class. Class. in a second operation. If a stable sorting algorithm is used in both cases, the class sorting operation will not change the name order; with an unstable sorting, it may be that the sorting by section mixes the name order. Using a stable sorting, users can choose to sort by section, then by name, first by sorting using the name, then sorting again using the section, resulting in the retention of the name order. (Some spreadsheet programs follow this behavior: sorting by name, then by section gives an alphabetical list of students per section.) More formally, the sorted data can be represented as a record or a value tuple, and the part of the data used for sorting is called the key. In the example of the card, the cards are represented as a record (rank, costume), and the key is the rank. A sorting algorithm is stable if each time there are two R and S records with the same key, and R appears before S in the original list, then R will always appear before S in the sorted list. When equal elements are indistinguishable, as with integs, or more generally, all data where the whole element is the key, stability is not a problem.
Recommended publications
  • The Analysis and Synthesis of a Parallel Sorting Engine Redacted for Privacy Abstract Approv, John M
    AN ABSTRACT OF THE THESIS OF Byoungchul Ahn for the degree of Doctor of Philosophy in Electrical and Computer Engineering, presented on May 3. 1989. Title: The Analysis and Synthesis of a Parallel Sorting Engine Redacted for Privacy Abstract approv, John M. Murray / Thisthesisisconcerned withthe development of a unique parallelsort-mergesystemsuitablefor implementationinVLSI. Two new sorting subsystems, a high performance VLSI sorter and a four-waymerger,werealsorealizedduringthedevelopment process. In addition, the analysis of several existing parallel sorting architectures and algorithms was carried out. Algorithmic time complexity, VLSI processor performance, and chiparearequirementsfortheexistingsortingsystemswere evaluated.The rebound sorting algorithm was determined to be the mostefficientamongthoseconsidered. The reboundsorter algorithm was implementedinhardware asasystolicarraywith external expansion capability. The second phase of the research involved analyzing several parallel merge algorithms andtheirbuffer management schemes. The dominant considerations for this phase of the research were the achievement of minimum VLSI chiparea,design complexity, and logicdelay. Itwasdeterminedthattheproposedmerger architecture could be implemented inseveral ways. Selecting the appropriate microarchitecture for the merger, given the constraints of chip area and performance, was the major problem.The tradeoffs associated with this process are outlined. Finally,apipelinedsort-merge system was implementedin VLSI by combining a rebound sorter
    [Show full text]
  • Coursenotes 4 Non-Adaptive Sorting Batcher's Algorithm
    4. Non Adaptive Sorting Batcher’s Algorithm 4.1 Introduction to Batcher’s Algorithm Sorting has many important applications in daily life and in particular, computer science. Within computer science several sorting algorithms exist such as the “bubble sort,” “shell sort,” “comb sort,” “heap sort,” “bucket sort,” “merge sort,” etc. We have actually encountered these before in section 2 of the course notes. Many different sorting algorithms exist and are implemented differently in each programming language. These sorting algorithms are relevant because they are used in every single computer program you run ranging from the unimportant computer solitaire you play to the online checking account you own. Indeed without sorting algorithms, many of the services we enjoy today would simply not be available. Batcher’s algorithm is a way to sort individual disorganized elements called “keys” into some desired order using a set number of comparisons. The keys that will be sorted for our purposes will be numbers and the order that we will want them to be in will be from greatest to least or vice a versa (whichever way you want it). The Batcher algorithm is non-adaptive in that it takes a fixed set of comparisons in order to sort the unsorted keys. In other words, there is no change made in the process during the sorting. Unlike other methods of sorting where you need to remember comparisons (tournament sort), Batcher’s algorithm is useful because it requires less thinking. Non-adaptive sorting is easy because outcomes of comparisons made at one point of the process do not affect which comparisons will be made in the future.
    [Show full text]
  • 1 Lower Bound on Runtime of Comparison Sorts
    CS 161 Lecture 7 { Sorting in Linear Time Jessica Su (some parts copied from CLRS) 1 Lower bound on runtime of comparison sorts So far we've looked at several sorting algorithms { insertion sort, merge sort, heapsort, and quicksort. Merge sort and heapsort run in worst-case O(n log n) time, and quicksort runs in expected O(n log n) time. One wonders if there's something special about O(n log n) that causes no sorting algorithm to surpass it. As a matter of fact, there is! We can prove that any comparison-based sorting algorithm must run in at least Ω(n log n) time. By comparison-based, I mean that the algorithm makes all its decisions based on how the elements of the input array compare to each other, and not on their actual values. One example of a comparison-based sorting algorithm is insertion sort. Recall that insertion sort builds a sorted array by looking at the next element and comparing it with each of the elements in the sorted array in order to determine its proper position. Another example is merge sort. When we merge two arrays, we compare the first elements of each array and place the smaller of the two in the sorted array, and then we make other comparisons to populate the rest of the array. In fact, all of the sorting algorithms we've seen so far are comparison sorts. But today we will cover counting sort, which relies on the values of elements in the array, and does not base all its decisions on comparisons.
    [Show full text]
  • An Efficient Evolutionary Algorithm for Solving Incrementally Structured
    An Efficient Evolutionary Algorithm for Solving Incrementally Structured Problems Jason Ansel Maciej Pacula Saman Amarasinghe Una-May O'Reilly MIT - CSAIL July 14, 2011 Jason Ansel (MIT) PetaBricks July 14, 2011 1 / 30 Our goal is to make programs run faster We use evolutionary algorithms to search for faster programs The PetaBricks language defines search spaces of algorithmic choices Who are we? I do research in programming languages (PL) and compilers The PetaBricks language is a collaboration between: A PL / compiler research group A evolutionary algorithms research group A applied mathematics research group Jason Ansel (MIT) PetaBricks July 14, 2011 2 / 30 The PetaBricks language defines search spaces of algorithmic choices Who are we? I do research in programming languages (PL) and compilers The PetaBricks language is a collaboration between: A PL / compiler research group A evolutionary algorithms research group A applied mathematics research group Our goal is to make programs run faster We use evolutionary algorithms to search for faster programs Jason Ansel (MIT) PetaBricks July 14, 2011 2 / 30 Who are we? I do research in programming languages (PL) and compilers The PetaBricks language is a collaboration between: A PL / compiler research group A evolutionary algorithms research group A applied mathematics research group Our goal is to make programs run faster We use evolutionary algorithms to search for faster programs The PetaBricks language defines search spaces of algorithmic choices Jason Ansel (MIT) PetaBricks July 14, 2011
    [Show full text]
  • 2.3 Quicksort
    2.3 Quicksort ‣ quicksort ‣ selection ‣ duplicate keys ‣ system sorts Algorithms, 4th Edition · Robert Sedgewick and Kevin Wayne · Copyright © 2002–2010 · January 30, 2011 12:46:16 PM Two classic sorting algorithms Critical components in the world’s computational infrastructure. • Full scientific understanding of their properties has enabled us to develop them into practical system sorts. • Quicksort honored as one of top 10 algorithms of 20th century in science and engineering. Mergesort. last lecture • Java sort for objects. • Perl, C++ stable sort, Python stable sort, Firefox JavaScript, ... Quicksort. this lecture • Java sort for primitive types. • C qsort, Unix, Visual C++, Python, Matlab, Chrome JavaScript, ... 2 ‣ quicksort ‣ selection ‣ duplicate keys ‣ system sorts 3 Quicksort Basic plan. • Shuffle the array. • Partition so that, for some j - element a[j] is in place - no larger element to the left of j j - no smaller element to the right of Sir Charles Antony Richard Hoare • Sort each piece recursively. 1980 Turing Award input Q U I C K S O R T E X A M P L E shu!e K R A T E L E P U I M Q C X O S partitioning element partition E C A I E K L P U T M Q R X O S not greater not less sort left A C E E I K L P U T M Q R X O S sort right A C E E I K L M O P Q R S T U X result A C E E I K L M O P Q R S T U X Quicksort overview 4 Quicksort partitioning Basic plan.
    [Show full text]
  • Quicksort Z Merge Sort Z T(N) = Θ(N Lg(N)) Z Not In-Place CSE 680 Z Selection Sort (From Homework) Prof
    Sorting Review z Insertion Sort Introduction to Algorithms z T(n) = Θ(n2) z In-place Quicksort z Merge Sort z T(n) = Θ(n lg(n)) z Not in-place CSE 680 z Selection Sort (from homework) Prof. Roger Crawfis z T(n) = Θ(n2) z In-place Seems pretty good. z Heap Sort Can we do better? z T(n) = Θ(n lg(n)) z In-place Sorting Comppgarison Sorting z Assumptions z Given a set of n values, there can be n! 1. No knowledge of the keys or numbers we permutations of these values. are sorting on. z So if we look at the behavior of the 2. Each key supports a comparison interface sorting algorithm over all possible n! or operator. inputs we can determine the worst-case 3. Sorting entire records, as opposed to complexity of the algorithm. numbers,,p is an implementation detail. 4. Each key is unique (just for convenience). Comparison Sorting Decision Tree Decision Tree Model z Decision tree model ≤ 1:2 > z Full binary tree 2:3 1:3 z A full binary tree (sometimes proper binary tree or 2- ≤≤> > tree) is a tree in which every node other than the leaves has two c hildren <1,2,3> ≤ 1:3 >><2,1,3> ≤ 2:3 z Internal node represents a comparison. z Ignore control, movement, and all other operations, just <1,3,2> <3,1,2> <2,3,1> <3,2,1> see comparison z Each leaf represents one possible result (a permutation of the elements in sorted order).
    [Show full text]
  • An Evolutionary Approach for Sorting Algorithms
    ORIENTAL JOURNAL OF ISSN: 0974-6471 COMPUTER SCIENCE & TECHNOLOGY December 2014, An International Open Free Access, Peer Reviewed Research Journal Vol. 7, No. (3): Published By: Oriental Scientific Publishing Co., India. Pgs. 369-376 www.computerscijournal.org Root to Fruit (2): An Evolutionary Approach for Sorting Algorithms PRAMOD KADAM AND Sachin KADAM BVDU, IMED, Pune, India. (Received: November 10, 2014; Accepted: December 20, 2014) ABstract This paper continues the earlier thought of evolutionary study of sorting problem and sorting algorithms (Root to Fruit (1): An Evolutionary Study of Sorting Problem) [1]and concluded with the chronological list of early pioneers of sorting problem or algorithms. Latter in the study graphical method has been used to present an evolution of sorting problem and sorting algorithm on the time line. Key words: Evolutionary study of sorting, History of sorting Early Sorting algorithms, list of inventors for sorting. IntroDUCTION name and their contribution may skipped from the study. Therefore readers have all the rights to In spite of plentiful literature and research extent this study with the valid proofs. Ultimately in sorting algorithmic domain there is mess our objective behind this research is very much found in documentation as far as credential clear, that to provide strength to the evolutionary concern2. Perhaps this problem found due to lack study of sorting algorithms and shift towards a good of coordination and unavailability of common knowledge base to preserve work of our forebear platform or knowledge base in the same domain. for upcoming generation. Otherwise coming Evolutionary study of sorting algorithm or sorting generation could receive hardly information about problem is foundation of futuristic knowledge sorting problems and syllabi may restrict with some base for sorting problem domain1.
    [Show full text]
  • Improving the Performance of Bubble Sort Using a Modified Diminishing Increment Sorting
    Scientific Research and Essay Vol. 4 (8), pp. 740-744, August, 2009 Available online at http://www.academicjournals.org/SRE ISSN 1992-2248 © 2009 Academic Journals Full Length Research Paper Improving the performance of bubble sort using a modified diminishing increment sorting Oyelami Olufemi Moses Department of Computer and Information Sciences, Covenant University, P. M. B. 1023, Ota, Ogun State, Nigeria. E- mail: [email protected] or [email protected]. Tel.: +234-8055344658. Accepted 17 February, 2009 Sorting involves rearranging information into either ascending or descending order. There are many sorting algorithms, among which is Bubble Sort. Bubble Sort is not known to be a very good sorting algorithm because it is beset with redundant comparisons. However, efforts have been made to improve the performance of the algorithm. With Bidirectional Bubble Sort, the average number of comparisons is slightly reduced and Batcher’s Sort similar to Shellsort also performs significantly better than Bidirectional Bubble Sort by carrying out comparisons in a novel way so that no propagation of exchanges is necessary. Bitonic Sort was also presented by Batcher and the strong point of this sorting procedure is that it is very suitable for a hard-wired implementation using a sorting network. This paper presents a meta algorithm called Oyelami’s Sort that combines the technique of Bidirectional Bubble Sort with a modified diminishing increment sorting. The results from the implementation of the algorithm compared with Batcher’s Odd-Even Sort and Batcher’s Bitonic Sort showed that the algorithm performed better than the two in the worst case scenario. The implication is that the algorithm is faster.
    [Show full text]
  • Overview Parallel Merge Sort
    CME 323: Distributed Algorithms and Optimization, Spring 2015 http://stanford.edu/~rezab/dao. Instructor: Reza Zadeh, Matriod and Stanford. Lecture 4, 4/6/2016. Scribed by Henry Neeb, Christopher Kurrus, Andreas Santucci. Overview Today we will continue covering divide and conquer algorithms. We will generalize divide and conquer algorithms and write down a general recipe for it. What's nice about these algorithms is that they are timeless; regardless of whether Spark or any other distributed platform ends up winning out in the next decade, these algorithms always provide a theoretical foundation for which we can build on. It's well worth our understanding. • Parallel merge sort • General recipe for divide and conquer algorithms • Parallel selection • Parallel quick sort (introduction only) Parallel selection involves scanning an array for the kth largest element in linear time. We then take the core idea used in that algorithm and apply it to quick-sort. Parallel Merge Sort Recall the merge sort from the prior lecture. This algorithm sorts a list recursively by dividing the list into smaller pieces, sorting the smaller pieces during reassembly of the list. The algorithm is as follows: Algorithm 1: MergeSort(A) Input : Array A of length n Output: Sorted A 1 if n is 1 then 2 return A 3 end 4 else n 5 L mergeSort(A[0, ..., 2 )) n 6 R mergeSort(A[ 2 , ..., n]) 7 return Merge(L, R) 8 end 1 Last lecture, we described one way where we can take our traditional merge operation and translate it into a parallelMerge routine with work O(n log n) and depth O(log n).
    [Show full text]
  • Parallel Sorting Algorithms + Topic Overview
    + Design of Parallel Algorithms Parallel Sorting Algorithms + Topic Overview n Issues in Sorting on Parallel Computers n Sorting Networks n Bubble Sort and its Variants n Quicksort n Bucket and Sample Sort n Other Sorting Algorithms + Sorting: Overview n One of the most commonly used and well-studied kernels. n Sorting can be comparison-based or noncomparison-based. n The fundamental operation of comparison-based sorting is compare-exchange. n The lower bound on any comparison-based sort of n numbers is Θ(nlog n) . n We focus here on comparison-based sorting algorithms. + Sorting: Basics What is a parallel sorted sequence? Where are the input and output lists stored? n We assume that the input and output lists are distributed. n The sorted list is partitioned with the property that each partitioned list is sorted and each element in processor Pi's list is less than that in Pj's list if i < j. + Sorting: Parallel Compare Exchange Operation A parallel compare-exchange operation. Processes Pi and Pj send their elements to each other. Process Pi keeps min{ai,aj}, and Pj keeps max{ai, aj}. + Sorting: Basics What is the parallel counterpart to a sequential comparator? n If each processor has one element, the compare exchange operation stores the smaller element at the processor with smaller id. This can be done in ts + tw time. n If we have more than one element per processor, we call this operation a compare split. Assume each of two processors have n/p elements. n After the compare-split operation, the smaller n/p elements are at processor Pi and the larger n/p elements at Pj, where i < j.
    [Show full text]
  • Lecture 16: Lower Bounds for Sorting
    Lecture Notes CMSC 251 To bound this, recall the integration formula for bounding summations (which we paraphrase here). For any monotonically increasing function f(x) Z Xb−1 b f(i) ≤ f(x)dx: i=a a The function f(x)=xln x is monotonically increasing, and so we have Z n S(n) ≤ x ln xdx: 2 If you are a calculus macho man, then you can integrate this by parts, and if you are a calculus wimp (like me) then you can look it up in a book of integrals Z n 2 2 n 2 2 2 2 x x n n n n x ln xdx = ln x − = ln n − − (2 ln 2 − 1) ≤ ln n − : 2 2 4 x=2 2 4 2 4 This completes the summation bound, and hence the entire proof. Summary: So even though the worst-case running time of QuickSort is Θ(n2), the average-case running time is Θ(n log n). Although we did not show it, it turns out that this doesn’t just happen much of the time. For large values of n, the running time is Θ(n log n) with high probability. In order to get Θ(n2) time the algorithm must make poor choices for the pivot at virtually every step. Poor choices are rare, and so continuously making poor choices are very rare. You might ask, could we make QuickSort deterministic Θ(n log n) by calling the selection algorithm to use the median as the pivot. The answer is that this would work, but the resulting algorithm would be so slow practically that no one would ever use it.
    [Show full text]
  • Advanced Topics in Sorting
    Advanced Topics in Sorting complexity system sorts duplicate keys comparators 1 complexity system sorts duplicate keys comparators 2 Complexity of sorting Computational complexity. Framework to study efficiency of algorithms for solving a particular problem X. Machine model. Focus on fundamental operations. Upper bound. Cost guarantee provided by some algorithm for X. Lower bound. Proven limit on cost guarantee of any algorithm for X. Optimal algorithm. Algorithm with best cost guarantee for X. lower bound ~ upper bound Example: sorting. • Machine model = # comparisons access information only through compares • Upper bound = N lg N from mergesort. • Lower bound ? 3 Decision Tree a < b yes no code between comparisons (e.g., sequence of exchanges) b < c a < c yes no yes no a b c b a c a < c b < c yes no yes no a c b c a b b c a c b a 4 Comparison-based lower bound for sorting Theorem. Any comparison based sorting algorithm must use more than N lg N - 1.44 N comparisons in the worst-case. Pf. Assume input consists of N distinct values a through a . • 1 N • Worst case dictated by tree height h. N ! different orderings. • • (At least) one leaf corresponds to each ordering. Binary tree with N ! leaves cannot have height less than lg (N!) • h lg N! lg (N / e) N Stirling's formula = N lg N - N lg e N lg N - 1.44 N 5 Complexity of sorting Upper bound. Cost guarantee provided by some algorithm for X. Lower bound. Proven limit on cost guarantee of any algorithm for X.
    [Show full text]