Research Article

A Splay Tree-Based Approach for Efficient Resource Location in P2P Networks

Algorithm 2

SERVER-SELECT(k, n)
(1) best + ∞
(2) for i 1 to k
(3)  do if C(pi) < best
(4)    then best C(pi)
(5) for i k + 1 to n
(6)  do if C(pi) < best
(7)    then return i
(8) return n