COS 212 Hashing and Searching Algorithms
10 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the method of hashing that uses a selection of digits as the key?

  • Skip Lists
  • Division
  • Extraction (correct)
  • Binary Search
  • What is the assumption made when extracting 3 digits as the key?

  • The majority of keys end in a 0
  • The part of the key is least likely to repeat (correct)
  • The key is perfectly unique
  • The key is perfectly random
  • What is the purpose of using the modulus operator in hash functions?

  • To increase the efficiency of the hash function
  • To reduce the size of the hash table
  • To ensure the indices are in the desired range (correct)
  • To reduce the number of collisions
  • What happens when the majority of keys end in a 0 in the hash table?

    <p>Collisions increase</p> Signup and view all the answers

    What is the advantage of the extraction method of hashing?

    <p>It is extremely simple and efficient</p> Signup and view all the answers

    What is the disadvantage of the extraction method of hashing?

    <p>Part of the key is used, resulting in less variation</p> Signup and view all the answers

    What is the purpose of using the hash function h(K) = K % T?

    <p>To ensure the indices are in the desired range</p> Signup and view all the answers

    What is the range of values returned by the modulus operator in hash functions?

    <p>[0, T - 1]</p> Signup and view all the answers

    What is the requirement for the indices generated by the hash function?

    <p>They must be in the range [0, T - 1]</p> Signup and view all the answers

    What is the result of using the hash function h(K) = K % 10 when the majority of keys end in a 0?

    <p>Collisions occur everywhere</p> Signup and view all the answers

    More Like This

    해싱(Hashing)에 대한 퀴즈
    25 questions
    COS 212 Hashing and Data Structures
    10 questions

    COS 212 Hashing and Data Structures

    NoteworthyExtraterrestrial avatar
    NoteworthyExtraterrestrial
    Use Quizgecko on...
    Browser
    Browser