📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    A hash map (or dictionary) implemented with separate

    chaining is exhibiting very poor performance, even with a seemingly good hash function. Operations like insertion and search are taking much longer than expected, approaching O(N) in many cases. What is the most likely debugging issue related to the collision resolution strategy?
    A The hash function is generating too many unique hash codes. Correct Answer Incorrect Answer
    B The underlying array (for buckets) is too large, leading to sparse data. Correct Answer Incorrect Answer
    C The linked lists (or other data structures) used for chaining are not being properly initialized or managed, leading to all elements being in a single bucket. Correct Answer Incorrect Answer
    D The equals() method (or __eq__ in Python) for the stored objects is not implemented correctly. Correct Answer Incorrect Answer
    E The hashCode() method (or __hash__ in Python) is not implemented for the stored objects. Correct Answer Incorrect Answer

    Solution

    The correct answer is C

    Practice Next
    More IT Operating System Questions
    ask-question