Friday, March 20, 2015

Friday, March 20th

Today was a very good class. My original aim was to finish Array 2 in that class, so that I would be able to say I finished it for my presentation on Tuesday. But, CodingBat didn't want me to finish and they made the last 6 or so problems much much harder than all of the other ones. What I mean by this is that they gave us problems in which you have to use almost everything you've learned in your answer. Flagging, boolean expressions, and loops. And so for me, it takes a while longer to complete since I still need a bit of practice to really master the logic. I should finish very quickly though, and move on to String 2 as soon as I can.

On Tuesday, I will be giving my quarter presentation. I always feel as if the presentation makes it seem like I did nothing throughout the quarter, and that also it gets repetitive for people who have been in the class since last semester.  I explain what CodingBat is, and how I use it, and relate it to the AP - but it's all been heard before by some of the people in our class. And also, it is quick to explain - and I feel like it doesn't really represent the work and the logic that needs to be used to solve these problems.
But, I will still try my best to explain it as well as possible, so that my classmates get a more thorough idea of what CodingBat is.

Here is today's rather complicated problem:

----------------------------------------------------------------------------------------------------------------------------------
We'll say that an element in an array is "alone" if there are values before and after it, and those values are different from it. Return a version of the given array where every instance of the given value which is alone is replaced by whichever value to its left or right is larger. 

notAlone({1, 2, 3}, 2) → {1, 3, 3}
notAlone({1, 2, 3, 2, 5, 2}, 2) → {1, 3, 3, 5, 5, 2}
notAlone({3, 4}, 3) → {3, 4}




Looking forward to presenting next class and listening to what others have been working on.


No comments:

Post a Comment