2015-10-27

posted Oct 27, 2015, 8:54 AM by Samuel Konstantinovich   [ updated Oct 27, 2015, 11:25 AM ]
Array Miscelanery

Do Now:
Array3 canBalance (in emacs, submit on coding bat as you are ready to)
Given a non-empty array, return true if there is a place to split the array so that the sum of the numbers on one side is equal to the sum of the numbers on the other side. 

canBalance({1, 1, 1, 2, 1}) → true
canBalance({2, 1, 1, 2, 1}) → false
canBalance({10, 10}) → true

Before you write your code how should you break it down to make it easier to write?

Classwork:
-Nested loops as separate methods
-canBalance twitch.



Comments