how to calculate big o notation - Search