Question

1.) The value 80 will place into which slot 0-9 in a hash table using the...

1.) The value 80 will place into which slot 0-9 in a hash table using the hash function h(k) = k mod 10

Your Answer:

2.)Given the following 2 functions - what is the value of calling fb(5,2)?


function fa(x, y){
if (y == 0) return 0;
return (x + fa(x, y-1));
}


function fb(x, y) {
if (y == 0) return 1;
return fa(x, fb(x, y-1));
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1.)
The value 80 will place into slot 0 in a hash table using the hash function h(k) = k mod 10
Answer:
0

2.)
the value of calling fb(5,2) is 25
Answer:
25
Add a comment
Know the answer?
Add Answer to:
1.) The value 80 will place into which slot 0-9 in a hash table using the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. Assume that you have a seven-slot hash table (the slots are numbered 0 through 6)....

    3. Assume that you have a seven-slot hash table (the slots are numbered 0 through 6). Show the final hash table that would result if you used the following approach to put 7, 13, 10,6 into the hash (4 points each) the hash function h(k)-k mod 7 and linear probing function the hash function h(k)-k mod 7 and quadratic probing (a) (b)

  • Part 5. Suppose that your hash function resolves collisions using the open addressing method with double...

    Part 5. Suppose that your hash function resolves collisions using the open addressing method with double hashing. The double hashing method uses two hash functions h and h'. Assume that the table size N = 13, h(k) = k mod 13, h'(k) = 1 + (k mod 11), and the current content of the hash table is: 0 1 2 3 6 7 8 9 10 11 12 4 17 5 98 If you insert k = 14 to this...

  • 10. Submission In this question you will work with a hash table that uses double hashing. The hash table is size 11, the primary hash function is h(K)-K mod 11, and the secondary hash function is hp(...

    10. Submission In this question you will work with a hash table that uses double hashing. The hash table is size 11, the primary hash function is h(K)-K mod 11, and the secondary hash function is hp(K)-(K mod9) +1 Take an empty hash table. Take your student number and split it into 4 2-digit integers. Insert each of these 2-digit numbers in the order in which they appear in your student number into the empty heap. Then insert the values...

  • Given the input sequence 4371, 1323, 6173, 4199, 4344, 9679, 1989, a hash table of size...

    Given the input sequence 4371, 1323, 6173, 4199, 4344, 9679, 1989, a hash table of size b=10, and a hash function h(x)=x mod b, show each step needed to build a hash table A closed hash table using double hashing, with the second hash function as h′(x)=7 − (x mod 7) This yields the sequence of hash functions hi(x)=(x mod b + i⋅ (7 − ( x mod 7)))mod b for i=0,1,…

  • Consider a hash function hashing a key K to a table of n buckets (indexed from...

    Consider a hash function hashing a key K to a table of n buckets (indexed from 0 to n - 1). Which of these would be acceptable hash functions -- meaning that they would work correctly for both insertions and searches? Assume the function Random(n) returns an integer between 0 and n - 1, inclusive. (Select all that apply). Group of answer choices 1. h(K) = k mod n 2. h(K) = Random(n) 3. h(K) = n 4. h(K) =...

  • SU 2020 Example Using Chaining 0 1 A hash table which is initially empty. Every element...

    SU 2020 Example Using Chaining 0 1 A hash table which is initially empty. Every element is a LinkedList object. Only the start pointer of the LinkedList object is shown, which is set to NULL 2 3 4 5 The hash function is: 6 h(k)=k%7 CS 2121 Deliverables • Insert Following Numbers in order of 31, 9, 36, 42, 46, 20, 2, 24 After Insertion, how how you find Number 9 and 2 Scan your completed work as FirstLastHw07.pdf to...

  • Insert elements into a hash table implemented using chain hashing, as an array of linked list...

    Insert elements into a hash table implemented using chain hashing, as an array of linked list in which each entry slot is as a linked list of key/value pairings that have the same hash (outcome value computed using certain hash function). You are allowed to use “Hash Function”, h(k) = k % x where, x is the value you will need to decide to use, that you find appropriate for this implementation. The main requirements are the following: 1. Input:...

  • 1. Let h be a hash function mapping U to indexes (0...m -1]. Assume that |U|...

    1. Let h be a hash function mapping U to indexes (0...m -1]. Assume that |U| m2 Could an adversary could pick a set K of m/2 keys from U which are all mapped into the same cell? What is the value of ΣzyEKFh(x,y) in this case ? Fh(x,y) is the function defined in the slides on the section discussing Universal Families of Hash functions.

  • 5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and...

    5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and the hash function h(x) = x mod 5. i. (1) Pick 8 random numbers in the range of 10 to 99 and write the numbers in the picked sequence. Marks will only be given for proper random numbers (e.g., 11, 12, 13, 14 ... or 10, 20, 30, 40, .. are not acceptable random sequences). ii. (2) Draw a sketch of the hash table...

  • 1. Suppose that a hash table contains hash_size = 13 entries indexed from 0 through 12...

    1. Suppose that a hash table contains hash_size = 13 entries indexed from 0 through 12 and that the following keys are to be mapped into the table: 24    34    33    55    46    38    37 The hash function determines the hash address by first summing all digits of a key (in ordinary decimal representation) and then applying % hash_size.    Answer the following questions. Assume that double hashing g(k) = 7 – (k mod 7) is used. Present the hash table...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT