回复:How about ( (A+B) - abs(A-B) ) / 2 ?

回答: solution to min and max in a big arraysub1012008-02-13 11:59:18

min is not ( (A+B) - abs(A-B) ) / 2. therefore, the algorithm is wrong.

所有跟帖: 

Why? 咱咋没找到反例? -techy- 给 techy 发送悄悄话 (0 bytes) () 02/13/2008 postreply 14:47:22

回复:(5+2)/2=3 -sub101- 给 sub101 发送悄悄话 (38 bytes) () 02/13/2008 postreply 14:53:55

可咱把你的除2移到最后了,加减出来的肯定是偶数 -techy- 给 techy 发送悄悄话 (86 bytes) () 02/13/2008 postreply 15:04:31

回复:You are absolutely right! -sub101- 给 sub101 发送悄悄话 (0 bytes) () 02/13/2008 postreply 15:08:07

ZT: You are absolutely right! -戏雨飞鹰- 给 戏雨飞鹰 发送悄悄话 (0 bytes) () 02/13/2008 postreply 16:48:05

请您先登陆,再发跟帖!