{"id":392,"date":"2012-08-09T23:50:05","date_gmt":"2012-08-10T06:50:05","guid":{"rendered":"http:\/\/blogs.unsw.edu.au\/comp1400\/?p=392"},"modified":"2012-08-09T23:51:32","modified_gmt":"2012-08-10T06:51:32","slug":"tutorial-wk-5","status":"publish","type":"post","link":"https:\/\/blogs.unsw.edu.au\/comp1400\/blog\/2012\/08\/tutorial-wk-5\/","title":{"rendered":"Tutorial Wk 5"},"content":{"rendered":"<p>If you did not finish all the exercises from last week\u2019s lab, try to finish them off this week. If you have already completed those exercises, try these ones.<\/p>\n<p><strong>Exercise 1.<\/strong> Write a method that accepts two arguments, an integer and an array of integers. Assume that the numbers in the array are sorted in ascending order. Your method should return a new array that is one element longer than the first array and with the first argument inserted into the array, in the correct position.<\/p>\n<p><strong>Exercise 2<\/strong>. Now suppose that we want to insert the number into the same array, rather than creating a new one. What would you have to do? What complications arise in this version and how would you handle them?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you did not finish all the exercises from last week\u2019s lab, try to finish them off this week. If you have already completed those exercises, try these ones. Exercise 1. Write a method that accepts two arguments, an integer and an array of integers. Assume that the numbers in the array are sorted in [&hellip;]<\/p>\n","protected":false},"author":80,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[630],"tags":[],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-lab"],"_links":{"self":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts\/392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/users\/80"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":3,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":394,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts\/392\/revisions\/394"}],"wp:attachment":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}