
{"id":15789,"date":"2014-05-12T14:50:54","date_gmt":"2014-05-12T14:50:54","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=15789"},"modified":"2014-05-12T14:50:54","modified_gmt":"2014-05-12T14:50:54","slug":"bubblethink-so-sort-in-python-programming-language","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2014\/05\/12\/bubblethink-so-sort-in-python-programming-language\/","title":{"rendered":"bubble(think so)  sort in python programming language"},"content":{"rendered":"<pre>\n# bubblesort attempted to be ported to python by\n# Jeffrin Jose T &lt;ahiliation@yahoo.co.in&gt;\n# from bubble.php by # detour@metalshell.com # License : GPL.\n\n&nbsp;\n\narray_size = 20;\n\nimport random\nresult = []\n\n# hash values of numbers between -5 to 256 are the same as the\n# numbers themselves. So, whatever may be the order, set will have them\n# in the sorted order. So, `result` cannot be a `set` here.\n\nfor x in range (0, 20):\n    num = random.randint(0, 20)\n    while num in result:\n        num = random.randint(0, 40)\n    result.append(num)\nprint result\n\n\nfor x in range (0,array_size):\n    for y in range (0,array_size):\n        if result[x] &lt; result[y]:\n            hold = result[x]\n            result[x] = result[y]\n            result[y] = hold\n\n\nfor x in range (0,array_size):\n    print result[x]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># bubblesort attempted to be ported to python by # Jeffrin Jose T &lt;ahiliation@yahoo.co.in&gt; # from bubble.php by # detour@metalshell.com # License : GPL. &nbsp; array_size = 20; import random result = [] # hash values of numbers between -5 to 256 are the same as the # numbers themselves. So, whatever may be the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2014\/05\/12\/bubblethink-so-sort-in-python-programming-language\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;bubble(think so)  sort in python programming language&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[91,93,108],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15789"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=15789"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15789\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=15789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=15789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=15789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}