completed max algorthm
completed both max and mergesort algorithms.