{"id":298,"date":"2022-05-24T19:05:53","date_gmt":"2022-05-24T18:05:53","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/?page_id=298"},"modified":"2022-05-24T19:14:39","modified_gmt":"2022-05-24T18:14:39","slug":"linear-search","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/linear-search\/","title":{"rendered":"Linear Search"},"content":{"rendered":"<p>This algorithm searches for a target item in an list of data items in an array and outputs the position of the target item and a Boolean value &#8211; found to confirm whether the item has been found &#8211; true if it has been found and false otherwise.<\/p>\n<p><strong style=\"color: red\">Example in Pseudocode<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-300\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190629\/Screenshot-2022-05-24-190410-300x154.png\" alt=\"\" width=\"545\" height=\"280\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190629\/Screenshot-2022-05-24-190410-300x154.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190629\/Screenshot-2022-05-24-190410-1024x525.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190629\/Screenshot-2022-05-24-190410-768x394.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190629\/Screenshot-2022-05-24-190410-624x320.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190629\/Screenshot-2022-05-24-190410.png 1162w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p><strong style=\"color: red\">Example in Python<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-301\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190645\/Screenshot-2022-05-24-190521-300x164.png\" alt=\"\" width=\"925\" height=\"506\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190645\/Screenshot-2022-05-24-190521-300x164.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190645\/Screenshot-2022-05-24-190521-1024x560.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190645\/Screenshot-2022-05-24-190521-768x420.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190645\/Screenshot-2022-05-24-190521-624x341.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24190645\/Screenshot-2022-05-24-190521.png 1260w\" sizes=\"auto, (max-width: 925px) 100vw, 925px\" \/><\/p>\n<p><strong style=\"color: red\">Example in Pseudocode<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-303\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191347\/Screenshot-2022-05-24-191310-300x197.png\" alt=\"\" width=\"515\" height=\"338\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191347\/Screenshot-2022-05-24-191310-300x197.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191347\/Screenshot-2022-05-24-191310-1024x673.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191347\/Screenshot-2022-05-24-191310-768x505.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191347\/Screenshot-2022-05-24-191310-624x410.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191347\/Screenshot-2022-05-24-191310.png 1168w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/p>\n<p><strong style=\"color: red\">Example in Python<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-304\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191359\/Screenshot-2022-05-24-191329-300x188.png\" alt=\"\" width=\"831\" height=\"521\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191359\/Screenshot-2022-05-24-191329-300x188.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191359\/Screenshot-2022-05-24-191329-1024x642.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191359\/Screenshot-2022-05-24-191329-768x482.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191359\/Screenshot-2022-05-24-191329-624x391.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/24191359\/Screenshot-2022-05-24-191329.png 1260w\" sizes=\"auto, (max-width: 831px) 100vw, 831px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This algorithm searches for a target item in an list of data items in an array and outputs the position of the target item and a Boolean value &#8211; found to confirm whether the item has been found &#8211; true if it has been found and false otherwise. Example in Pseudocode Example in Python Example [&hellip;]<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-298","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/comments?post=298"}],"version-history":[{"count":4,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/298\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/298\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/media?parent=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}