|
|
| About site: Algorithms/Sorting and Searching - Comparison sort |
Return to Computers also Computers |
| About site: http://en.wikipedia.org/wiki/Comparison_sort |
Title: Algorithms/Sorting and Searching - Comparison sort From Wikipedia, the free encyclopedia. Definition, examples, lower bound. |
|
|
|
|
International_Society_for_Adaptive_Behavior An international scientific society devoted to education and furthering research on adaptive behavior in animals, animats, software agents, and robots.
| Computer_Users_of_Erie The largest and oldest user group in the Erie, PA, USA area. Focusing primarily on the PC, Mac and Linux platforms with a wide range of members. Meeting, newsletter and library details.
| INSYSCOM_Corporation Networking and information technology consulting company in New England area specializing in providing Linux based solutions.
| UBoard Unofficial Euphoria message-board, with different threads, including topics like Win32Lib, Win4Eu, EuGtk, and a tutoring system for beginners.
| EDGE_Tech_Corp Supplier of RAM and Flash memory upgrades, digital media cards, portable storage devices.
| Stuart_Wilkins Computer training and support. I teach friendly, professional classes on many different aspects of PC's and Macintoshes. Located in Australia.
|
|
| Alexa statistic for http://en.wikipedia.org/wiki/Comparison_sort |
Please visit: http://en.wikipedia.org/wiki/Comparison_sort
|
| Related sites for http://en.wikipedia.org/wiki/Comparison_sort |
| Castup_net Aids in adding streaming video and audio to your web site. | | Japan_Mobile_Information Your premier source of Information on the Japanese wireless industry (focussing on i-mode). | | Ho-Base__Technology_Co__Ltd_ Manufacturer of cable assemblies, terminal housing, wafers, USB and moulding cable series. Located in Taiwan. | | Ceilidh Group discussion program, written in C, for the World Wide Web. Threaded bulletin boards for BeOS, Mac, OS/2, UNIX and Windows web servers. | | PGP_related_RFC PGP query results in HTML format with tables of contents and crosslinked references | | Translation_of_apt_(Debian_package_transfer_tool) Debian's apt needs translations. This is a place for translators to coordinate and for users to download the newest translations. | | Item_Inc_ Specializes in Xerox, QMS, and Tektronix for printer and parts sales. Also offers office equipment. | | Reviewnow_com Supplies a large source of shareware and freeware. | | John_Battelle\'s_Searchblog Commentary on search, media, and technology from the author of The Search (2005). | | XSB A research-oriented Logic Programming system for Unix and Windows/DOS-based systems, representing a semantically enriched functional superset of Prolog and offering among other things evaluation throu | | ApiWare!_-_ASP_Scripts myForm, mySponsors, myCounter, myGuestbook ASP scripts. | | Dodgson,_Neil University of Cambridge - Autostereoscopic 3D imaging, rendering algorithms, compression. | | Gilmore,_Stephen University of Edinburgh - PEPA stochastic process algebra, Standard ML functional programming language. | | Arrow It displays each mailbox and message in a separate window, thereby allowing one to simultaneously open as many mailboxes and view and compose as many messages as one wishes. | | Server_Spy Displays the brand of web servers in the status-bar. | | GentleSource_Link_and_Bookmark_Manager Link manager can be used as link section of a website or a personal bookmark manager. You can publish links/bookmarks or hide them behind a login. [Free for private usage and non-profit organizations] | | Exclusive_Web_Design Offers design, e-commerce, promotion, and maintenance services. | | Ambitious_Web_Services_Corporation Offers design, hosting, shopping carts, promotion, and programming. Located in Tulsa, Oklahoma, United States. | | JAR_Web_Design Offers design, database, hosting, and marketing services. | | Proxy_Users_Network Proxy web master and user discussion forum. |
|
This is websites2007.org cache of m/ as retrieved on 2008.10.11 websites2007.org's cache is the snapshot that we took of the page as we crawled the web. The page may have changed since that time.
|
Comparison sort - Wikipedia, the free encyclopedia /**/ Comparison sort From Wikipedia, the free encyclopedia Jump to: navigation, search  Sorting a set of unlabelled weights by weight using only a balance scale requires a comparison sort algorithmA comparison sort is a type of sorting algorithm that only reads the list elements through a single abstract comparison operation (often a "less than or equal to" operator) that determines which of two elements should occur first in the final sorted list. The only requirement is that the operator obey the three defining properties of a total order:if a ≤ b and b ≤ a then a = b (antisymmetry)if a ≤ b and b ≤ c then a ≤ c (transitivity)a ≤ b or b ≤ a (totalness or trichotomy)A metaphor for thinking about comparison sorts is that you have a set of unlabelled weights and a balance scale. The goal is to line up the weights in order by their weight without any information except that obtained by placing two weights on the scale and seeing which one is heavier (or if they weigh the same).Contents1 Examples2 Performance limits and advantages3 Number of comparisons required to sort a list3.1 Lower bound for the average number of comparisons4 Notes5 References//[edit] ExamplesSome of the most well-known comparison sorts include:QuicksortHeapsortMerge sortIntrosortInsertion sortSelection sortBubble sortSome examples of sorts which are not comparison sorts include:Radix sort (examines individual bits of keys)Counting sort (indexes using key values)Bucket sort (examines bits of keys)[edit] Performance limits and advantagesThere are fundamental limits on the performance of comparison sorts. A comparison sort must have a lower bound of Ω(n log n) comparison operations in the worst case. This is a consequence of the limited information available through comparisons alone — or, to put it differently, of the vague algebraic structure of totally ordered sets. In this sense, mergesort, heapsort, and introsort are asymptotically optimal in terms of the number of comparisons they must perform, although this metric neglects other operations. The three non-comparison sorts above achieve O(n) performance by using operations other than comparisons, allowing them to sidestep this lower bound (assuming elements are constant-sized).Nevertheless, comparison sorts offer the notable advantage that control over the comparison function allows sorting of many different datatypes and fine control over how the list is sorted. For example, reversing the result of the comparison function allows the list to be sorted in reverse, and it's simple to sort a list of tuples in lexicographic order by just creating a comparison function that compares by each part in sequence:function tupleCompare((lefta, leftb, leftc), (righta, rightb, rightc)) if lefta ≠righta return compare(lefta, righta) else if leftb ≠rightb return compare(leftb, rightb) else return compare(leftc, rightc)Balanced ternary notation allows comparisons to be made in one step, whose result will be one of "less than", "greater than" or "equal to".Comparison sorts generally adapt more easily to complex orders such as the order of floating-point numbers. Additionally, once a comparison function is written, any comparison sort can be used without modification; non-comparison sorts typically require specialized versions for each datatype.This flexibility, together with the efficiency of the above comparison sorting algorithms on modern computers, has led to widespread preference for comparison sorts in most practical work.[edit] Number of comparisons required to sort a listThe number of comparisons that a comparison sort algorithm requires increases in proportion to nlog(n), where n is the number of elements to sort. This bound is asymptotically tight:Given a list of distinct numbers (we can assume this because this is a worst-case analysis), there are n factorial permutations exactly one of which is the list in sorted order. The sort algorithm must gain enough information from the comparisons to identify the correct permutations. If the algorithm always completes after at most f(n) steps, it cannot distinguish more than 2f(n) cases because the keys are distinct and each comparison has only two possible outcomes. Therefore, , or equivalently .From Stirling's approximation we know that log2(n!) is Ω(nlog2n). This provides the lower-bound part of the claim.An identical upper bound follows from the existence of the algorithms that attain this bound in the worst case.The above argument provides an absolute, rather than only asymptotic lower bound on the number of comparisons, namely comparisons. This lower bound is fairly good (it can be approached within a linear tolerance by a simple merge sort), but it is known to be inexact. For example, , but the minimal number of comparisons to sort 13 elements has been proved to be 34 [1].Determining the exact number of comparisons needed to sort a given number of entries is a computationally hard problem even for small n, and no simple formula for the solution is known. For some of the few concrete values that have been computed, see A036604.[edit] Lower bound for the average number of comparisonsA similar bound applies to the average number of comparisons. Assuming thatall keys are distinct, i.e. every comparison will give either a>b or a<b, andthe input is a random permutation, chosen uniformly from the set of all possible permutations of n elements,it is impossible to determine which order the input is in with fewer than log2(n!) comparisons on average.This can be most easily seen using concepts from information theory. The Shannon entropy of such a random permutation is log2(n!) bits. Since a comparison can give only two results, the maximum amount of information it provides is 1 bit. Therefore after k comparisons the remaining entropy of the permutation, given the results of those comparisons, is at least log2(n!) - k bits on average. To perform the sort, complete information is needed, so the remaining entropy must be 0. It follows that k must be at least log2(n!).Note that this differs from the worst case argument given above, in that it does not allow rounding up to the nearest integer. For example, for n = 3, the lower bound for the worst case is 3, the lower bound for the average case as shown above is approximately 2.58, while the highest lower bound for the average case is 8/3, approximately 2.67.In the case that multiple items may have the same key, there is no obvious statistical interpretation for the term "average case", so an argument like the above cannot be applied without making specific assumptions about the distribution of keys.[edit] Notes^ Marcin Peczarski: The Ford-Johnson algorithm still unbeaten for less than 47 elements. Inf. Process. Lett. 101(3): 126-128 (2007) doi:10.1016/j.ipl.2006.09.001[edit] ReferencesDonald Knuth. The Art of Computer Programming, Volume 3: Sorting and Searching, Second Edition. Addison-Wesley, 1997. ISBN 0-201-89685-0. Section 5.3.1: Minimum-Comparison Sorting, pp.180–197.Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Section 8.1: Lower bounds for sorting, pp.165–168.Retrieved from "http://en.wikipedia.org/wiki/Comparison_sort" Categories: Sorting algorithms Views Article Discussion Edit this page History Personal tools Log in / create account if (window.isMSIE55) fixalpha(); Navigation Main page Contents Featured content Current events Random article Search Interaction About Wikipedia Community portal Recent changes Contact Wikipedia Donate to Wikipedia Help Toolbox What links here Related changesUpload fileSpecial pages Printable version Permanent linkCite this page This page was last modified on 6 May 2008, at 14:16. All text is available under the terms of the GNU Free Documentation License. (See Copyrights for details.) Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a U.S. registered 501(c)(3) tax-deductible nonprofit charity. Privacy policy About Wikipedia Disclaimers if (window.runOnloadHook) runOnloadHook(); |
|
| |
From | Wikipedia, | the | free | encyclopedia. | Definition, | examples, | lower | bound. |
|
http://en.wikipedia.org/wiki/Comparison_sort
Comparison sort 2008 October
dvd rental
dvd
From Wikipedia, the free encyclopedia. Definition, examples, lower bound.
Rules
|
© 2008 Internet Explorer 5+ or Netscape 6+
|
|
Recommended Sites: 1.
Arts -
Business -
Computers -
Games -
Health -
Home -
Kids and Teens -
News -
Recreation -
Reference -
Regional -
Science -
Shopping -
Society -
Sports -
World
Miss Gallery
- Top Anime Hentai
- DVD rental by mail
- MySpace Layouts - Credit Card - Personal Loans - Mortgage - Refinance
|