def testMaximumSubarrayRecLrg(self):
     findMax = MaxSubarrayImplementations()
     array = [
         13, -3, -25, 20, -3, -16, -23, 18, 20, -7, 12, -5, -22, 15, -4, 7
     ]
     result = findMax.maximumSubarrayBF(array, 0, 15)
     self.failUnless(result == (7, 10, 43))
 def testMaximumSubarrayRecLrg(self):
     findMax = MaxSubarrayImplementations()
     array = [13, -3, -25, 20, -3, -16, -23, 18, 20, -7, 12, -5, -22, 15, -4, 7]
     result = findMax.maximumSubarrayBF(array, 0, 15)
     self.failUnless(result == (7, 10, 43))
 def testMaximumSubarrayBFOneElement(self):
     findMax = MaxSubarrayImplementations()
     result = findMax.maximumSubarrayBF([3], 0, 0)
     self.failUnless(result == (0, 0, 3)) 
 def testMaximumSubarrayRecSm(self):
     findMax = MaxSubarrayImplementations()
     array = [0, 1, -4, 3, -4]
     result = findMax.maximumSubarrayRec(array, 0,4)
     self.failUnless(result == (3, 3, 3))
 def testMaxCrossingSubarayLrg(self):
     findMax = MaxSubarrayImplementations()
     array = [-3, 2, 4, -1, 2, -4]
     result = findMax.findMaxCrossingSubarray(array, 0, 3, 5)
     self.failUnless(result == (1, 4, 7))
 def testMaxCrossingSubaraySm(self):
     findMax = MaxSubarrayImplementations()
     array = [-23, 18, 20]
     result = findMax.findMaxCrossingSubarray(array, 0, 1, 2)
     self.failUnless(result == (0, 2, 15))
 def testMaxCrossingSubarayOne(self):
     findMax = MaxSubarrayImplementations()
     result = findMax.findMaxCrossingSubarray([-3], 0, 0, 0)
     print result
     self.failUnless(result == (0, 0, -3))
 def testMaximumSubarrayBFOneElement(self):
     findMax = MaxSubarrayImplementations()
     result = findMax.maximumSubarrayBF([3], 0, 0)
     self.failUnless(result == (0, 0, 3))
 def testMaximumSubarrayRecSm(self):
     findMax = MaxSubarrayImplementations()
     array = [0, 1, -4, 3, -4]
     result = findMax.maximumSubarrayRec(array, 0, 4)
     self.failUnless(result == (3, 3, 3))
 def testMaxCrossingSubarayLrg(self):
     findMax = MaxSubarrayImplementations()
     array = [-3, 2, 4, -1, 2, -4]
     result = findMax.findMaxCrossingSubarray(array, 0, 3, 5)
     self.failUnless(result == (1, 4, 7))
 def testMaxCrossingSubaraySm(self):
     findMax = MaxSubarrayImplementations()
     array = [-23, 18, 20]
     result = findMax.findMaxCrossingSubarray(array, 0, 1, 2)
     self.failUnless(result == (0, 2, 15))
 def testMaxCrossingSubarayOne(self):
     findMax = MaxSubarrayImplementations()
     result = findMax.findMaxCrossingSubarray([-3], 0, 0, 0)
     print result
     self.failUnless(result == (0, 0, -3))