4 votes 4 votes If one block access time is 30ms,then what is the access time for 100 blocks index if we use binary search? Databases indexing + – sumedha asked Aug 2, 2016 • edited Aug 2, 2016 by Prashant. sumedha 1.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 8 votes 8 votes since avg access time in binary search is log2N and here N=100 so it will be Log2100 =30x7 =210ms Sanjay Sharma answered Aug 2, 2016 • selected Aug 2, 2016 by Prashant. Sanjay Sharma comment Share Follow See all 3 Comments See all 3 3 Comments reply Deeksha varshney 1 commented Jan 12, 2018 reply Follow Share dont we have to add +1 for accessing the data block 0 votes 0 votes Purva Taranekar commented Aug 5, 2018 reply Follow Share I have the same doubt. I guess, to access blocks of index, we require log B + 1 unit time. 0 votes 0 votes akash.dinkar12 commented Oct 20, 2018 i edited by akash.dinkar12 Oct 20, 2018 reply Follow Share Purva Taranekar This depends on which u are performing block access,, i mean if u are applying binary search on index file which is in nature sorted then it would be log2B + 1 and if u are applying binary search on sorted data file then it would be log2B. the reason why we are doing this extra +1 is first we have to apply binary search on the index file and after then by reading block address form block pointer field in an index file, we have to go for accessng at least one block in data file too... 0 votes 0 votes Please log in or register to add a comment.