In hashing, what is the primary purpose of a hash function?

25 views
  • To sort data in ascending order
  • To map keys to indices in a hash table (Correct Answer)
  • To traverse a linked list
  • To create a binary tree

Explanation

A hash function maps a given key to an index in a hash table, allowing constant-time access for insertion, deletion, and search operations in ideal conditions.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs