Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Fill in the blank: A binary search is faster than a sequential search for ___

ID: 3547194 • Letter: 1

Question

1. Fill in the blank: A binary search is faster than a sequential search for ______ lists.


2. Short Answer: Explain how a sequential search works in 1 or 2 sentences.


3. True or False: On average, a sequential search algorithm searches the entire list.


4. What is the primary advantage of using open hashing/chaining?


5. Hash tables are stored in a/an

a. Linked list

b. Array

c. User-defined ADT

d. Derived class


6. When two objects have the same address in the hash table, there is a ____________. If the number of elements assigned to a certain address goes over the allotted bucket size, an _____________ occurs.


7. What are the main objectives of a hash function?


8. Consider the following code:

void putElementIntoHashTable(int parValue, int parKey){

if (this->key == parKey){

//call the collision case function

collisionCase();

}

else{

//some code here to put the element into the hash table

}

}

For the answer to this question, describe a logical method for collisionCase() with written pseudocode:

9. Which of the following effectively describes a hash table?

a. An array-like structure whose indexes are keys associated with values; these keys and values are contained in a class.

b. A stack-like structure whose indexes are keys associated with values; these keys and values are contained in a class.

c. A structure that is searched via the binary search method.

d. A structure contained in the STL whose indexes are keys associated with values; these keys and values are contained in a class.

e. A structure contained in the STL which is easily searched via keys.


10. Assume you have a set of data. The special member of the data set that uniquely identifies each item of the data set is called______________.


11. Briefly describe what sequential search and binary search are, and compare and contrast the advantages and disadvantages of the two search methods.


12. Suppose you have been requested to design a search algorithm for finding the student whose name is unique---not shared by anyone who has attended Berea College. Assume Alumni Relations has the record sorted based on class (class of 1900, 2016,

Explanation / Answer

1.A binary search is faster than a sequential search for _sorted_____ lists.


2.SEQUENTIAL Function works: sequential search is a method for finding a particular value in a list, that consists of checking every one of its elements, one at a time and in sequence, until the desired one is found. Sequential search is the simplest form of search. Records can be arranged in a file in two ways; one, sequentially one after the other. The other is non-sequential. Sequential search is applicable to the file wherein the N records R1, R2,