made improvements to findMajoritySorted, findMajorityUnsorted and findPivotInRotatedArray