Question

when you build a hash function you will want to achieve its run time as T(N)=O(?)...

when you build a hash function you will want to achieve its run time as T(N)=O(?) where N - is the size of input value/object for your hash function? Meaning, you want to hash a string of 1 million characters and a string of 1 character. Will run times be significantly different?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

--> when we build a hash function, we will ideally want to achieve its run time as T(N) = O(1). i..e. constant time

--> when you want to hash a string of 1 million characters and a string of 1 character, their run times will

      significantly be different because for string of 1 million characters we have process all the characters to

      generate hash.

Add a comment
Know the answer?
Add Answer to:
when you build a hash function you will want to achieve its run time as T(N)=O(?)...
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
  • 0. Introduction. This involves designing a perfect hash function for a small set of strings. It...

    0. Introduction. This involves designing a perfect hash function for a small set of strings. It demonstrates that if the set of possible keys is small, then a perfect hash function need not be hard to design, or hard to understand. 1. Theory. A hash table is an array that associates keys with values. A hash function takes a key as its argument, and returns an index in the array. The object that appears at the index is the key’s...

  • Problem 3 Suppose that you have a set of n large, orderable, objects, each of size...

    Problem 3 Suppose that you have a set of n large, orderable, objects, each of size q, so that it requires time e(a) to time to compute a hash function h(a) for any object and requires time e(g) to compare any two objects. Describe a compound data structure, built out of a heap and a hash table, that supports the following operations with the specified run times.. elt (x) Is x an element of the set? Expected run time O(g)....

  • PLEASE CODE IN PYTHON Run-length encoding is a simple compression scheme best used when a data-set...

    PLEASE CODE IN PYTHON Run-length encoding is a simple compression scheme best used when a data-set consists primarily of numerous, long runs of repeated characters. For example, AAAAAAAAAA is a run of 10 A’s. We could encode this run using a notation like *A10, where the * is a special flag character that indicates a run, A is the symbol in the run, and 10 is the length of the run. As another example, the string KKKKKKKKKKKKKBCCDDDDDDDDDDDDDDDKKKKKMNUUUGGGGG would be encoded...

  • A program with a quadratic run time takes t seconds to run, when given an input...

    A program with a quadratic run time takes t seconds to run, when given an input size n. If the same algorithm is given input of size 2n, then the program will take approximately how many seconds? a. 2t b. t c. 4t d. 6t

  • JAVA: Run length encoding is a simple form of data compression. It replaces long sequences of...

    JAVA: Run length encoding is a simple form of data compression. It replaces long sequences of a repeated value with one occurrence of the value and a count of how many times to repeat it. This works reasonably well when there are lots of long repeats such as in black and white images. To avoid having to represent non-repeated runs with a count of 1 and the value, a special value is often used to indicate a run and everything...

  • 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:...

  • Purpose: Once you have completed and tested the functionality of your MyStringBuilder class, you will do...

    Purpose: Once you have completed and tested the functionality of your MyStringBuilder class, you will do a rough comparative test to see how long some of the operations take relative to the predefined StringBuilder class and the predefined String class. Details: You will complete a simple simulation to compare the times required for three operations: append(char c) , insert(int loc, char c) and delete(int start, int stop) These methods are defined in the StringBuilder and MyStringBuilder classes, but you will...

  • If the length of the array P is 4 and the length of the array T...

    If the length of the array P is 4 and the length of the array T is 14, how many shifts of P need to be performed in the string searching algorithm? a. 9 b. 10 c. 11 d. 12 What is the best case for the naive string search algorithm? a. The first character of the pattern P isn't present in text T b. All characters in pattern P are different c. All characters in text T are different...

  • Demonstrate how you can construct an Iterative Hash h function using the Merkle- Damgard Design. Use...

    Demonstrate how you can construct an Iterative Hash h function using the Merkle- Damgard Design. Use as your compression function f:{0, 1}^v times {0, 1}^b rightarrow {0, 1}^v, AES with 512-bit keys. Explain what the values of v and b will be in your compression function and where in the block cipher (AES) are you using the blocks of the message you want to hash. Using the iterative hash function you just create above, show how a digest for a...

  • You have to use a h file for class definitions and two (as specified below) cpp...

    You have to use a h file for class definitions and two (as specified below) cpp file for the C++ implementation. You have to generate the list from scratch and check for overflow I will be giving extra points (up to 2 points this time) to students that exceed the requirements posed in the assignments. For example, extensive testing, checking for exceptions, and usable user interface. Please submit enough screenshots showing compiling and execution under Linux. Write a main program...

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