Problemas
A time stamp indicates the date and time that a measurement was taken. A data scientist has a list containing 10,000 time stamps, sorted in chronological order. Which of the following is closest to the maximum number of values that will need to be examined when performing a binary search for a value in the list? A 10 B 15 C 5,000 D 10,000
Solución
Aldanaprofessionell · Tutor durante 6 años
Verificación de expertos
4.5 (320 votos)
Responder
To perform a binary search on a sorted list, the maximum number of values that need to be examined is determined by the logarithm of the number of elements in the list. In this case, the list contains 10,000 time stamps.<br /><br />The maximum number of values that need to be examined can be calculated as follows:<br /><br />log2(10,000) ≈ 13.6<br /><br />Since the number of values must be an integer, we round up to the nearest whole number, which is 14.<br /><br />Therefore, the closest answer is (B) 15.
Haz clic para calificar: