I found this on the "interview questions" website and pondered it for a couple of days. I will continue to chat, but I wonder what you guys think
"10 GB of 32-bit tape numbers, everything is from 0 to 10G in random order. You have 64 32-bit memory words: design an algorithm to check that every number from 0 to 10G happens once and only one times on a tape with minimal tape passes using a read head connected to your algorithm. "
Do 2 reducefor numbers, sum and bitwise XOR.
reduce
(10G + 1) * 10G/2XOR ... -
, . 10G 32b 10G. () () , , .
32- 4G = 2 ^ 32 . 2,5 * 2 ^ 32 . 2 ^ 32 100%. <= 2 ^ 32, , - .
quicksort, ? , , = + 1.
, , .
: oh bugger, , .
: 30- . IE 1,2,3,4,5 , 8,9,10,11,12 .. , . , , , ... , , , .
, .
, , , , , , . , , . .
, , , - 64 , 64 , , , - . O (n) , .
, , - , , 32- .
, , . ,
(i) , 10G, - , ? , , , , ( , )? , , , .
(ii) , 10G , ; ? , , , , ?
, , , 10 , 64 32- ; , , ; , ?
, , , ; wold ?
, Samba
Source: https://habr.com/ru/post/1728407/More articles:URLRequest with DELETE Method - flexFastest way to convert a string of type id = 1 & type = 2 to an array in PHP? - stringIndividually execute all files in a directory - bashHow to find all types of dependencies of a certain type in any CLR-based language assembly? - c #WCF service debugging caused by a Windows service in C # - c #Eliminate the need for a “controller” in the Zend Framework controller file name - phpTechnique, CreateDelegate and General Methods - genericshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1728410/ways-to-marshal-a-pointer-of-array-of-struct&usg=ALkJrhgIe8DFtAu1gQV849B0y6MwxAFvJwЛучший способ маршалировать указатель массива структуры - c++Как скомпилировать PHP5 в Apache 2 статически? - apache2All Articles