{"id":896,"date":"2022-06-14T10:07:43","date_gmt":"2022-06-14T07:07:43","guid":{"rendered":"https:\/\/www.juustila.com\/antti\/?p=896"},"modified":"2022-06-14T10:07:43","modified_gmt":"2022-06-14T07:07:43","slug":"new-version-of-sortspectacle","status":"publish","type":"post","link":"https:\/\/www.juustila.com\/antti\/2022\/06\/14\/new-version-of-sortspectacle\/","title":{"rendered":"New version of SortSpectacle"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">My sorting algorithm learning tool \/ demo app <a href=\"https:\/\/github.com\/anttijuu\/SortSpectacle\">SortSpectacle<\/a> now includes a new method, <strong>Block sort<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Block_sort\">Block sort<\/a> is a variant of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Merge_sort\">Merge sort<\/a>. Merge sort uses additional arrays to recursively divide the original array into smaller arrays which are then sorted and combined to a final sorted array.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Block sort is an in-place variant of Merge sort. It uses a small cache to move elements around. Thus it is more memory efficient than Merge sort. And according to the demo app, also quite fast.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I still need to implement the step-by-step version of the algorithm &#8212;  without it the execution is not animated. But if you take a look a the implementation (a Swift port I did based on the Java code <em>WikiSort<\/em> <a href=\"https:\/\/github.com\/BonzaiThePenguin\/WikiSort\">implemented<\/a> by Mike McFadden), you can see that it will be quite a challenge to do&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also it was quite nice to read in Twitter that <em>someone is actually using my sorting algorithms<\/em> in their own Swift\/SwiftUI app to demonstrate the new SwiftUI <a href=\"https:\/\/developer.apple.com\/documentation\/Charts\">Charts<\/a> in action! <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyhows, here&#8217;s a YouTube demo video showing the new version in action:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"SortSpectacle 2022-6\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/xeXszpIwsmY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>My sorting algorithm learning tool \/ demo app SortSpectacle now includes a new method, Block sort. Block sort is a variant of Merge sort. Merge sort uses additional arrays to recursively divide the original array into smaller arrays which are then sorted and combined to a final sorted array. Block sort is an in-place variant &hellip; <a href=\"https:\/\/www.juustila.com\/antti\/2022\/06\/14\/new-version-of-sortspectacle\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;New version of SortSpectacle&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[2],"tags":[48,39,46,12],"class_list":["post-896","post","type-post","status-publish","format-standard","hentry","category-coding","tag-algorithms","tag-performance","tag-swift","tag-teaching"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/comments?post=896"}],"version-history":[{"count":1,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/896\/revisions"}],"predecessor-version":[{"id":898,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/896\/revisions\/898"}],"wp:attachment":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/media?parent=896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/categories?post=896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/tags?post=896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}