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 (A)</p> Signup and view all the answers

What is the advantage of the extraction method of hashing?

<p>It is extremely simple and efficient (A)</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 (B)</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 (A)</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] (D)</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] (C)</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 (B)</p> Signup and view all the answers

More Like This

Hashing
72 questions

Hashing

CourtlyErudition avatar
CourtlyErudition
해싱(Hashing)에 대한 퀴즈
25 questions
Use Quizgecko on...
Browser
Browser