一个有序的整数list,没有duplicates 问怎样查找最快。

View previous topic View next topic Go down

一个有序的整数list,没有duplicates 问怎样查找最快。

Post  Admin on Wed Nov 09, 2011 3:59 pm

比如c[a:b],找x
那么binary search就是check c[a+(b-a)/2]
linear interpolation就是check c[a+(b-a)*(x-c[a])/(c[b]-c[a])]

Admin
Admin

Posts : 131
Join date : 2011-08-16

View user profile http://codefornongeek.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum