Help:=proc(): print(`MaxSlow(L), MaxFast(L)`): end: MaxSlow:=proc(L) local i, cha,rec: rec:=L[1]: cha:=1: for i from 2 to nops(L) do if L[i]>rec then rec:=L[i]: cha:=i: fi: od: cha,rec: end: #MaxFast(L): a hopefully faster way to comoute max MaxFast:=proc(L) local n,L1,L2,a1,a2,cha,rec: if nops(L)=1 then RETURN(1,L[1]): fi: n:=trunc(nops(L)/2): L1:=[op(1..n,L)]: L2:=[op(n+1..nops(L),L)]: a1:=MaxFast(L1): a2:=MaxFast(L2): if a1[2]>a2[2] then RETURN(a1): else RETURN(a2[1]+n,a2[2]): fi: FAIL: end: