# a function which returns the maximum of its two parameters def max2(a,b): ''' max(float,float) ---> float return the maximum od a and b ''' if a>=b: return a else: return b # a function which returns the maximum of its three parameters # version 1 def max3_v1(a,b,c): if a>=b: if a>=c: return a else: return c else: if b>=c: return b else: return c # version 2 def max3_v2(a,b,c): return max2(max2(a,b), c) # version 3 def max3_v3(a,b,c): if a>=b and a>=c: return a elif b>=a and b>=c: return b else: return c # what is the maximal number of comparison performed by each of the versions # for the worst-case input ?