{"id":1139,"date":"2016-03-12T18:23:10","date_gmt":"2016-03-12T17:23:10","guid":{"rendered":"http:\/\/monodes.com\/predaelli\/?p=1139"},"modified":"2016-03-12T18:23:10","modified_gmt":"2016-03-12T17:23:10","slug":"sorting-algorithm-animations","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2016\/03\/12\/sorting-algorithm-animations\/","title":{"rendered":"Sorting Algorithm Animations"},"content":{"rendered":"<h2><em><a href=\"http:\/\/www.sorting-algorithms.com\/\">Sorting Algorithm Animations<\/a><a href=\"http:\/\/www.sorting-algorithms.com\/\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1140\" data-permalink=\"https:\/\/monodes.com\/predaelli\/2016\/03\/12\/sorting-algorithm-animations\/sorts\/\" data-orig-file=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/03\/sorts.jpeg?fit=600%2C658&amp;ssl=1\" data-orig-size=\"600,658\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sorts\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/03\/sorts.jpeg?fit=510%2C559&amp;ssl=1\" class=\"aligncenter wp-image-1140 size-full\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/03\/sorts-1.jpeg?resize=600%2C658\" alt=\"[cml_media_alt id='1140']sorts[\/cml_media_alt]\" width=\"600\" height=\"658\" \/><\/a><\/em><\/h2>\n<p><!--more--><\/p>\n<blockquote><p>These pages show 8 different sorting algorithms on 4 different initial conditions. These visualizations are intended to:<\/p>\n<ul>\n<li>Show how each algorithm operates.<\/li>\n<li>Show that there is no best sorting algorithm.<\/li>\n<li>Show the advantages and disadvantages of each algorithm.<\/li>\n<li>Show that worse-case asymptotic behavior is not always the deciding factor in choosing an algorithm.<\/li>\n<li>Show that the initial condition (input order and key distribution) affects performance as much as the algorithm choice.<\/li>\n<\/ul>\n<p>The ideal sorting algorithm would have the following properties:<\/p>\n<ul>\n<li>Stable: Equal keys aren&#8217;t reordered.<\/li>\n<li>Operates in place, requiring O(1) extra space.<\/li>\n<li>Worst-case O(n\u00b7lg(n)) key comparisons.<\/li>\n<li>Worst-case O(n) swaps.<\/li>\n<li>Adaptive: Speeds up to O(n) when data is nearly sorted or when there are few unique keys.<\/li>\n<\/ul>\n<\/blockquote>\n<p><!--more--><\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Sorting Algorithm Animations<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2016\/03\/12\/sorting-algorithm-animations\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1139","post","type-post","status-publish","format-standard","hentry","category-senza-categoria"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-in","jetpack-related-posts":[{"id":14169,"url":"https:\/\/monodes.com\/predaelli\/2025\/10\/24\/how-to-emulate-hand-drawn-shapes-algorithms-behind-roughjs-shihn-ca\/","url_meta":{"origin":1139,"position":0},"title":"How to emulate hand-drawn shapes \/ Algorithms behind RoughJS | shihn.ca","author":"Paolo Redaelli","date":"2025-10-24","format":false,"excerpt":"How to emulate hand-drawn shapes \/ Algorithms behind RoughJS | shihn.ca A dive into graphics algorithms used in RoughJS - A graphics library that lets you draw in a sketchy, hand-drawn-like, style. How to emulate hand-drawn shapes \/ Algorithms behind RoughJS A dive into graphics algorithms used in RoughJS -\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2025\/10\/cover.png?fit=480%2C480&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":15334,"url":"https:\/\/monodes.com\/predaelli\/2026\/03\/15\/how-can-we-trust-them\/","url_meta":{"origin":1139,"position":1},"title":"How can we trust them?","author":"Paolo Redaelli","date":"2026-03-15","format":false,"excerpt":"When I found Algorithms with TypeScript I told myself \"wow, that's an interesting book!\" And the premises are really catching: This book grew out of a simple observation: most software engineers use algorithms and data structures every day, yet many feel uncertain about the fundamentals. \u2026 Algorithms with TypeScript bridges\u2026","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9329,"url":"https:\/\/monodes.com\/predaelli\/2022\/04\/30\/machine-learning-algorithms-cheat-sheet-by-anthony-barrios-accel-ai-medium\/","url_meta":{"origin":1139,"position":2},"title":"Machine Learning Algorithms Cheat Sheet | by Anthony Barrios | Accel.AI | Medium","author":"Paolo Redaelli","date":"2022-04-30","format":false,"excerpt":"Source: Machine Learning Algorithms Cheat Sheet | by Anthony Barrios | Accel.AI | Medium","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11594,"url":"https:\/\/monodes.com\/predaelli\/2024\/04\/10\/algorithmic-apocalypse-computers-dominating-market-health-decisions\/","url_meta":{"origin":1139,"position":3},"title":"Algorithmic Apocalypse: Computers Dominating Market, Health Decisions","author":"Paolo Redaelli","date":"2024-04-10","format":"link","excerpt":"Fears about AI making decisions for you in the future are misplaced \u2014 because computers already control your life. Source: Algorithmic Apocalypse: Computers Dominating Market, Health Decisions","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9401,"url":"https:\/\/monodes.com\/predaelli\/2022\/05\/26\/the-simdjson-library\/","url_meta":{"origin":1139,"position":4},"title":"The simdjson library","author":"Paolo Redaelli","date":"2022-05-26","format":false,"excerpt":"The simdjson library Parsing gigabytes of JSON per second JSON is everywhere on the Internet. Servers spend a lot of time parsing it. The simdjson library uses commonly available SIMD instructions and microparallel algorithms to break speed records.","rel":"","context":"In &quot;Agenda&quot;","block_context":{"text":"Agenda","link":"https:\/\/monodes.com\/predaelli\/category\/agenda\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9460,"url":"https:\/\/monodes.com\/predaelli\/2022\/06\/20\/ntru-quantum-resistant-cryptography\/","url_meta":{"origin":1139,"position":5},"title":"NTRU \u2013Quantum resistant cryptography","author":"Paolo Redaelli","date":"2022-06-20","format":"link","excerpt":"NTRU \u2013 Software According to Wikipedia NTRU is an open-source public-key cryptosystem that uses lattice-based cryptography to encrypt and decrypt data. ... Unlike other popular public-key cryptosystems, it is resistant to attacks using Shor's algorithm. NTRUEncrypt was patented, but it was placed in the public domain in 2017. NTRUSign is\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/1139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=1139"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/1139\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=1139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=1139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=1139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}