{"id":609,"date":"2010-09-19T16:53:31","date_gmt":"2010-09-19T21:53:31","guid":{"rendered":"http:\/\/www.apluscompsci.com\/blog\/?p=609"},"modified":"2010-09-19T20:44:48","modified_gmt":"2010-09-20T01:44:48","slug":"java-writemycode-vol-i-biginteger","status":"publish","type":"post","link":"https:\/\/www.apluscompsci.com\/blog\/java-writemycode-vol-i-biginteger\/","title":{"rendered":"Java.writeMyCode() &#8211; Vol. I &#8211; BigInteger"},"content":{"rendered":"<p>Programming contests are very popular in Texas and most areas of the state <a href=\"http:\/\/www.apluscompsci.com\/cs_cont_list.htm\">host<\/a> at least 1 each month.\u00a0 They are great vehicles through which to increase enrollment and to get students excited about &#8220;cranking code&#8221;.<\/p>\n<p>It is very important to know what tools are available in your language before attending a contest.\u00a0 If the language being used provides a tool to help solve a problem, then teams should use that tool as part of the solution instead of writing every single line of code from scratch.\u00a0 I stress to my students to never re-invent the wheel.\u00a0 If the language already has a perfectly good wheel, put that sucker on your car and hit the road.<\/p>\n<p>Java has lots of cool stuff built-in.\u00a0 BigInteger is a class that has many methods in it that can make solving certain math related contest problems much easier.\u00a0 BigInteger contains an isProbablePrime() method.\u00a0 This is quite useful at contests.<\/p>\n<div id=\"attachment_614\" style=\"width: 482px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.apluscompsci.com\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-614\" class=\"size-full wp-image-614\" title=\"bigint\" src=\"http:\/\/www.apluscompsci.com\/blog\/wp-content\/uploads\/2010\/09\/bigint2.PNG\" alt=\"Using BigInteger in Java\" width=\"472\" height=\"395\" srcset=\"https:\/\/www.apluscompsci.com\/blog\/apluscom\/apluscompsci.com\/blog\/wp-content\/uploads\/2010\/09\/bigint2.PNG 472w, https:\/\/www.apluscompsci.com\/blog\/apluscom\/apluscompsci.com\/blog\/wp-content\/uploads\/2010\/09\/bigint2-300x251.PNG 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/a><p id=\"caption-attachment-614\" class=\"wp-caption-text\">Using BigInteger in Java<\/p><\/div>\n<p>It is equally important that student understand the algorithm being used to determine if a number is prime and how to create such an algorithm.\u00a0 Learning the fundamental algorithmic concepts is critical to being a well rounded CS student, but for contest purposes, it is all about speed and accuracy so using built-in methods where possible helps save time and prevent errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Programming contests are very popular in Texas and most areas of the state host at least 1 each month.\u00a0 They are great vehicles through which to increase enrollment and to get students excited about &#8220;cranking code&#8221;. It is very important to know what tools are available in your language before attending a contest.\u00a0 If the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[22,15,31],"_links":{"self":[{"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/posts\/609"}],"collection":[{"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/comments?post=609"}],"version-history":[{"count":4,"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/posts\/609\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/posts\/609\/revisions\/613"}],"wp:attachment":[{"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/media?parent=609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/categories?post=609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.apluscompsci.com\/blog\/wp-json\/wp\/v2\/tags?post=609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}