If the last entry in a cluster is removed, it doesn’t need to be replaced with a bridge. Outline how this might be implemented and discuss the advantages and disadvantages of making this change to answer the question: Is it worth the effort?

What will be an ideal response?


You would need to check if the next bucket contained either an entry or a bridge. If not, then you could make the bucket empty. An advantage of this would be to break future clusters. Consider the following scenario in which the first letter of a name is the key and the key range is ‘A’ to ‘Z’. After hashing “Bob”, “Betty” and “Billy”, the buckets for ‘B’, ‘C’ and ‘D’ are occupied. A search for “Borat” would have to go all the way to ‘E’ to discover failure. Now, if “Billy” is deleted and is replaced by a Bridge, then “Edgar” gets inserted, a new search for “Borat” would have to go all the way to ‘F’ to discover failure. If, instead, when “Billy” was deleted and the next bucket (‘E’) was discovered empty and ‘D’ was made empty, then after “Edgar” is inserted, a search for “Borat” would fail sooner at ‘D’. Since clusters can hurt performance, this sounds like a worthwhile change to make.

Computer Science & Information Technology

You might also like to view...

The following program has been partitioned into two files. Before we commented out the keyword namespace and the curly braces that were around func(int) this program compiled and had this output:

``` func(5) = 25 junk(5) = 75 ``` Will the code compile now? If so, predict the output and explain. ``` // This goes in file A.cpp //namespace // //{ int func(int i) { return i*3; } //} int junk (int i) { return i*func(i); } // This goes in file B.cpp #include int func(int i) { return i*5; } int junk(int i); //from A.cpp int main() { cout <<”func(5) = “ << func(5) << endl; cout <<”junk(5) = “ << junk(5) << endl; ``` What will be an ideal response?

Computer Science & Information Technology

Explain the push, pop and top operations of a stack.

What will be an ideal response?

Computer Science & Information Technology

A ________ is a prebuilt chart format that applies an overall visual look to a chart

A) chart layout B) chart style C) chart design D) chart template

Computer Science & Information Technology

One way to create a new master is to display the slide masters by clicking the View tab on the Ribbon, and then clicking the Slide Master button. In the Edit Master group, click the ____ Slide Master button.

A. Insert B. Create C. New D. Edit

Computer Science & Information Technology