Penjee.com 's Blog

How to Remove Element from Java Array

The AP Computer Science A exam often asks students to resize an array, typically by removing some stuff from the array, stuff that doesn’t meet some kind of criteria. I have already gone over an AP styled question  here on this, but let’s now look at some more intuitive code for removing an element from … Continue reading How to Remove Element from Java Array →

AP Computer Science Array Practice Problem

The AP Computer Science A exam likes to ask questions along the lines of this code pictured below: Download Code The question is,.. what does the “mystery” method do to that input array ?…. What is the output ?   And the answer is… Scroll down a bit         [crayon-6767dd1acbc8d260380134/]   Yes, this … Continue reading AP Computer Science Array Practice Problem →

Sorting Java Array in 1 Loop (Psuedo Sorting) AP Java Prep

So  ..our student , Jeff was trying to write an method that sorts an array of ints  , called [crayon-6767dd1acc3ed685607631-i/] , using a single loop. He wrote the code below:. Download code .   Here you can download a powerpoint with a step by step visual explanation. So, was Jeff successful? When this code is run, will the method return … Continue reading Sorting Java Array in 1 Loop (Psuedo Sorting) AP Java Prep →