The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
137 views

Consider a hash table with chaining scheme for overflow handling:

  1. What is the worst-case timing complexity of inserting $n$ elements into such a table?
  2. For what type of instance does this hashing scheme take the worst-case time for insertion?
asked in Algorithms by Veteran (42.7k points)
edited by | 137 views

1 Answer

+1 vote
1.) The worst case can be O(n) if all the insertions collide at the same key.

2.) This happens when we are not using an uniformly distributed hash function or when our hash table has only a single key where all the elements are chained up.
answered by Junior (561 points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,017 questions
36,844 answers
91,383 comments
34,722 users