Hash Tables - Quiz

  • A It is faster than open addressing.
  • B It results in a more compact table than open addressing.
  • C It can handle an arbitrary number of collisions.
  • D It requires less memory than open addressing.
  • A When two or more keys map to the same index in the table.
  • B When the hash function produces a negative index.
  • C When the table is full and cannot store any more elements.
  • D When the load factor of the table exceeds a certain threshold.
  • A It can lead to clustering of elements in the table.
  • B It requires more memory than separate chaining.
  • C It requires more time to access elements than separate chaining.
  • D It cannot handle collisions efficiently.
  • A Linear probing
  • B Binary search
  • C Depth-first search
  • D Breadth-first search
  • A The number of elements in the table divided by the number of slots in the table.
  • B The number of collisions in the table divided by the number of elements in the table.
  • C The number of slots in the table divided by the number of elements in the table.
  • D The number of elements in the table divided by the size of the hash function.
  • A To determine the order in which elements are stored in the table
  • B To map keys to unique indices in the table
  • C To sort the elements in the table
  • D To count the number of elements in the table
  • A A function that maps every key to the same index in the table.
  • B A function that maps every key to a unique index in the table.
  • C A function that maps every key to a random index in the table.
  • D A function that maps every key to an index based on its length.
  • A Sorting data
  • B Storing data in a stack
  • C Storing data in a heap
  • D Implementing a dictionary or map
  • A A data structure that stores data in a random order
  • B A data structure that stores data in a sorted order
  • C A data structure that maps keys to values using a hash function
  • D A data structure that links nodes together to form a list