jeudi 11 mai 2017

a list of nodes that should be visit with equal chance

its nearly a week that I'm thinking on it but still .....

imagine that theres one list of hundred product and hundred visitor each visitor in 1st step visit only 20 product so if we show the products from the beginning of the list to whole users the 1st twenties ones get seen and others not

my first solution for solving this is that give a weight to all the products and the weight increase one number after getting visited , so the the 21st visitor see the 21st product

but here another problem occurs that when we reached to end of the list how back to which nodes of the list for a user

a simple solution for this is making random number , but is there a guaranty that whole the list nodes visit with the generated random number

import java.util.Random;

Random rand = new Random();

int n = rand.nextInt(50) + 1;

a random code like that ,and specially when the list dynamically increases

thanks and more if anyone got a solution for this problem




Aucun commentaire:

Enregistrer un commentaire