Question

In: Computer Science

Suppose that we are using extendable hashing on a file that contains records with the following...

Suppose that we are using extendable hashing on a file that contains records with the following search-key values: (2, 3, 5, 7, 11, 17, 19, 23, 29, 31). Show the final extendable hash structure for this file if the hash function is h(x) = x mod 8 and buckets can hold three records. Recall that:

1. the bucket address table is indexed by the prefix of the binary representation of h(x).

2. Initially i = 0, i.e. the prefix consists of zero bits. There is only one bucket. There is one entry in the address table whose key = null (since prefix size = 0) with a pointer that points to the only bucket we have.

Solutions

Expert Solution


Related Solutions

Using Python. A file exists on the disk named students.txt. The file contains several records, and...
Using Python. A file exists on the disk named students.txt. The file contains several records, and each record contains two fields: (1) the student’s name, and (2) the student’s score for the final exam. Write code that deletes the record containing “John Perz”as the student name. This the code i have so far but it's not working: import os def main(): found=False search='John Perz' student_file = open('student.txt','r') temp_file = open('temp_students.txt','w') name=student_file.readline() score='' while name !='': score=student_file.readline() name=name.rstrip('/n') score=score.rstrip('/n') if name...
Suppose we have a sequential ordered file of 200,000 records, where each record is 200 bytes....
Suppose we have a sequential ordered file of 200,000 records, where each record is 200 bytes. Assume blocksize = 2048 bytes (10 records per block), average seek time = 10 ms, average rotational delay = 8.3 ms, and block transfer time = 0.8 ms. Suppose we want to make X independent random record reads from the file. This could be done in two different approaches. read the entire file once and look for the X records of interest use a...
For each of the following file processing operations, indicate whether a sequential file, indexed random file, virtual storage access method, hashing,
For each of the following file processing operations, indicate whether a sequential file, indexed random file, virtual storage access method, hashing, or pointer structure would work best. You may choose as many as you wish for each step. Also, indicate which would perform the least optimally.a. Retrieve a record from the file based on its primary key value.b. Update a record in the file. c. Read a complete file of records. d. Find the next record in a file. e....
Suppose we have an input file that contains information about how many hours each employee of...
Suppose we have an input file that contains information about how many hours each employee of a company has worked. The file looks like the following (Employee's name, Hours): John 6.5 9.5 7.25 9 8.55 Oscar 12.5 13.5 14 16 18.75 Judith 7 7 7 ••• Construct a program that reads this file and calculates the total number of hours worked by each individual. Make sure that the program handles each specific exception that could occur.' python
If the file circuit.txt contains the following data
Exercise 2: If the file circuit.txt contains the following data 3.0             2.1 1.5             1.1 2.6             4.1 The first column is voltage and the second column is the electric current. Write program that reads the voltages and currents then calculates the electric power (P) based on the equation: Voltage     Current        Power 3.0             2.1              (result) 1.5             1.1              (result) 2.6             4.1              (result)                         P = v * i Write your output to the file results.txt with voltage in the first, current in the second...
Done in c++ Read this file one time to determine how many records it contains. Be...
Done in c++ Read this file one time to determine how many records it contains. Be sure to check for a successful file open here. Close the file. Allocate memory dynamically to store the data from step 1. This dynamically allocated memory should be for an array of strings. The array size should be exactly the number of records from step 1. Reopen the file and read it a second time, storing each record into the array of strings from...
Implement one of the hashing procedures that we have discussed, and the following related functions: INSERT...
Implement one of the hashing procedures that we have discussed, and the following related functions: INSERT (item) DELETE (item) FIND (item) Make sure that your program correctly handles collisions and full hash table!
In a hashing structure a. two records can be stored at the same address. b. pointers are used to indicate ..
In a hashing structure a. two records can be stored at the same address.b. pointers are used to indicate the location of all records.c. pointers are used to indicate location of a record with the same address as another record.d. all locations on the disk are used for record storage.
Suppose a file (whose name is given through an argument by the user) contains student names...
Suppose a file (whose name is given through an argument by the user) contains student names and their scores (ranging from 0 to 100): i.e. each line contains a student name (just the first name with no space inside) and the student’s score separated by a space. Find out who has the highest score with what score, and who has the lowest score with what score. Also, calculate the average of all of the scores. Do not use arrays to...
Suppose a file (whose name is given through an argument by the user) contains student names...
Suppose a file (whose name is given through an argument by the user) contains student names and their scores (ranging from 0 to 100): i.e. each line contains a student name (just the first name with no space inside) and the student’s score separated by a space. Find out who has the highest score with what score, and who has the lowest score with what score. Also, calculate the average of all of the scores. Do not use arrays to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT