[DCCP] tfrc: Binary search for reverse TFRC lookup
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Sun, 3 Dec 2006 16:53:27 +0000 (14:53 -0200)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Sun, 3 Dec 2006 16:53:27 +0000 (14:53 -0200)
This replaces the linear search algorithm for reverse lookup with
binary search.

It has the advantage of better scalability: O(log2(N)) instead of O(N).
This means that the average number of iterations is reduced from 250
(linear search if each value appears equally likely) down to at most 9.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>

No differences found