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

JAVA PROGRAMMING QUESTIONS 1. A recursive method is used to calculate 6 4 . The

ID: 3574721 • Letter: J

Question

JAVA PROGRAMMING QUESTIONS

1.      A recursive method is used to calculate 64. The base case is 60.

What is the first value returned from the recursive invocations?

a. 1

b. 2

c. 0

d. -1

2.      The primary storage area in a nonperfect hashed data structure is a 103 element array. A key has been mapped into index 102, and a collision has occurred. Select the indices calculated by the next three passes through the collision algorithm if the collision algorithm is the modified version of the:
                                         Quadratic Probing

a. 4

b. 2

c. 0

d. 1

e. 13

3.      In an _____________ scheme the collision algorithm always generates locations inside the primary storage area, and each location in the primary storage area references a single node.

a. open addressing

b. fetched addressing

c. non-open addressing

d. hashed addressing

4.      Objects to be stored in a data structure each have 1000 bytes of information, which includes the key field comprised of 5 digits. A maximum of 1500 nodes will be in the structure at one time. If the nodes are stored using a: Direct hashing function with 100,000 elements, calculate the density ofthe structure?

a.       0.790

b. 0.590

c. 0.75

d. 0.999

5.      A _________________ scheme could use a linked list to store the addresses of all node that hash into the same home location in the primary storage area.

a. fetched addressing

b. non-open addressing

c. hashed addressing

d. open addressing

a. -1,298,231,929

b. 1,298,231,939

c. 1,298,231,929

d. 1,299,231,929

7.      Java contains a class that implements a dynamic hashed data structure. How does it resolve collisions?

a. buckets

b. rehash

c. unlink

d. delete

JAVA PROGRAMMING QUESTIONS

1.      A recursive method is used to calculate 64. The base case is 60.

What is the first value returned from the recursive invocations?

a. 1

b. 2

c. 0

d. -1

2.      The primary storage area in a nonperfect hashed data structure is a 103 element array. A key has been mapped into index 102, and a collision has occurred. Select the indices calculated by the next three passes through the collision algorithm if the collision algorithm is the modified version of the:
                                         Quadratic Probing

a. 4

b. 2

c. 0

d. 1

e. 13

3.      In an _____________ scheme the collision algorithm always generates locations inside the primary storage area, and each location in the primary storage area references a single node.

a. open addressing

b. fetched addressing

c. non-open addressing

d. hashed addressing

4.      Objects to be stored in a data structure each have 1000 bytes of information, which includes the key field comprised of 5 digits. A maximum of 1500 nodes will be in the structure at one time. If the nodes are stored using a: Direct hashing function with 100,000 elements, calculate the density ofthe structure?

a.       0.790

b. 0.590

c. 0.75

d. 0.999

5.      A _________________ scheme could use a linked list to store the addresses of all node that hash into the same home location in the primary storage area.

a. fetched addressing

b. non-open addressing

c. hashed addressing

d. open addressing

6.      Assuming keys are comprised of upper- and lowercase letters, give the bit pattern and base 10 numeric value of the pseudo key that would result from processing the key "Mary" using the algorithm illustrated in image below.

a. -1,298,231,929

b. 1,298,231,939

c. 1,298,231,929

d. 1,299,231,929

7.      Java contains a class that implements a dynamic hashed data structure. How does it resolve collisions?

a. buckets

b. rehash

c. unlink

d. delete

For the numeric key: 987845369, the key is folded about 845. 845 The addition is performed as: Thus, the pseudo key would be 201 2201 For the non-numeric key: "AlMcAllister the key is folded about the second grouping Alli. The addition is performed as: Alli 0100 0001 0110 1100 0110 1100 0110 1001 AlMc 0100 0001 0110 1100 0100 1101 0110 001 1 ster 0111 0011 0111 0100 0110 0101 0111 0010 1111 0110 0100 1101 0001 1111 0011 1110 Treating this result asa positive 32 bit integer, the pseudo key would be 4,132, 249,406.

Explanation / Answer

1. c. 0

2. 1 or 2 or 0

3. a. open addressing

4. a.       0.790

5. c. hashed addressing

6. b. 1,298,231,939

7. Bucket