{"id":226049,"date":"2018-11-27T18:17:43","date_gmt":"2018-11-27T10:17:43","guid":{"rendered":"http:\/\/magicalbits.net\/?p=226049"},"modified":"2018-11-27T18:17:43","modified_gmt":"2018-11-27T10:17:43","slug":"complexity-and-big-o-notation-in-swift-journey-of-one-thousand-apps-medium","status":"publish","type":"post","link":"https:\/\/magicalbits.net\/?p=226049","title":{"rendered":"Complexity and Big-O Notation In Swift \u2013 Journey Of One Thousand Apps \u2013 Medium"},"content":{"rendered":"<blockquote><p>An O(n\u00b2) operation\u2019s complexity scales exponentially with the number of inputs. A simple example of an O(n\u00b2) is a process with a loop within a loop. If you took an array with six elements and for each element of the array accessed nth element in the range of 0..&lt;array.count you would access your array 36 times. Your complexity is not scaling directly with input, but for input squared. A worst case scenario for a bubble sort is O(n\u00b2).<\/p><\/blockquote>\n<p>Source: <em><a href=\"https:\/\/medium.com\/journey-of-one-thousand-apps\/complexity-and-big-o-notation-in-swift-478a67ba20e7\">Complexity and Big-O Notation In Swift \u2013 Journey Of One Thousand Apps \u2013 Medium<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An O(n\u00b2) operation\u2019s complexity scales exponentially with the number of inputs. A simple example of an O(n\u00b2) is a process with a loop within a loop. If you took an array with six elements and for each element of the array accessed nth element in the range of 0..&lt;array.count you would access your array 36 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-226049","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/magicalbits.net\/index.php?rest_route=\/wp\/v2\/posts\/226049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/magicalbits.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/magicalbits.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/magicalbits.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/magicalbits.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226049"}],"version-history":[{"count":1,"href":"https:\/\/magicalbits.net\/index.php?rest_route=\/wp\/v2\/posts\/226049\/revisions"}],"predecessor-version":[{"id":226050,"href":"https:\/\/magicalbits.net\/index.php?rest_route=\/wp\/v2\/posts\/226049\/revisions\/226050"}],"wp:attachment":[{"href":"https:\/\/magicalbits.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/magicalbits.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/magicalbits.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}