Research Article

Privacy Preserving k-Nearest Neighbor for Medical Diagnosis in e-Health Cloud

Algorithm 1

PE-FTK.
Input: dataset , where n is the number of data si and l is the size of the data si.
k is the number of the largest data to find among dataset
Output: where Resi = 1 if si is one of the top-k data and Resi = 0, otherwise
(1) = [0] for
(2)for do
(3) for
(4)[Cnt] = 
(5)
(6)if then
(7)  break
(8)end if
(9) for
(10)if then
(11)  return
(12)end if
(13)end for
(14) for
(15)for do
(16)[Cnt] = 
(17)if then
(18)   for
(19)  return
(20)end if
(21)
(22) for
(23) for
(24)end for
(25)return