/*************************************** * ******************************* // 18. select 1000 keywords to give a data stream, it contains endless search keywords (for example, keywords that people continuously enter during Google search ). How can we randomly select 1000 keywords from this endless stream? *//************************************* * ********************************** // I don't know, right, generates an array (ARR) of 1000 to store the results ~ 999 keywords are stored in arr with probability 1, for 1000 ~ The 1999 keywords are updated with the probability 1/2 respectively. The elements in the corresponding array arr are updated by 1000 to 0, 1001 to 1, and... I is updated by I % 1000,... for 2000 ~ The first keywords are updated with probability 2999 respectively. The elements in the corresponding array arr are updated by 1/3 to 0, 2000 to 1 ,... I update I % 1000 ,........ update at a probability of 1/4 */