All Exams Test series for 1 year @ ₹349 only
Question

Given a fixed‐length record file that is ordered on the key field. The file needs B disk blocks to store R number of records. Find the average access time needed to access any record of the given file using binary search.

The correct answer is

log 2 B

Binary search halves the remaining range of disk blocks after each comparison. Searching B ordered blocks therefore requires about \(\log_2 B\) block accesses, with average and worst-case cost of logarithmic order. A cost of about B/2 belongs to a sequential scan, not binary search.

Was this answer helpful?

Important Questions from Binary Search Tree - Teaching

  1. The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?

  2. Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?

  3. Suppose that we have numbers between 1 and 1,000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined ?

  4. In a ____the left and right subtrees for any given node, differ in height by more than one.

  5. Which of the following description(s) is/are true:

    A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.

    B. Trie - Used for efficient prefix - based searches.

    C. AVL Tree - self balancing binary search tree with looser balance criteria than a Red Black Tree.

    D. B- Tree -  Allows efficient search, inert, delete operations in disk based system.

    Choose the correct answer from the options given below:

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App