Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6246041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:37:01+00:00 2026-05-24T12:37:01+00:00

How do we find out the average and the worst case time complexity of

  • 0

How do we find out the average and the worst case time complexity of a Search operation on Hash Table which has been Implemented in the following way:

Let’s say ‘N’ is the number of keys that are required to be hashed. We take a hash table of size M (M=alpha*N, alpha ~ 0.1). Collisions are resolved by storing the keys in a chained linked list fashion, storing each new entry at the head of each linked list pointed to by ‘hashTable[i]’.

IMHO, the best , avg and worst case complexities could be O(1), O(N/M) and O(N). Correct me if I am wrong. A detailed explanation would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:37:03+00:00Added an answer on May 24, 2026 at 12:37 pm

    The answer depends on the characteristics of the hashing function, and the particular value of alpha. The worst case occurs if the hash achieves poor distribution (for any alpha), and as you stated in your original post, is O(N). The best case occurs when you have a well-distributed hash and alpha is relatively large (>1.0), and as you said, that is O(1). So we agree on the best case and worst case.

    However I think the average case needs more analysis, because alpha has a non-linear effect on performance. Consider two extreme examples. Case 1, alpha = 100, 1000, 10000. As alpha scales to infinity, you will have no avoidable collisions (i.e. those caused by having to truncate hashes to map into M buckets, as opposed to non-uniform behavior of the hash), and so the average case converges to the best case, or O(1). Case 2, alpha = 0.01, 0.001, 0.0001. As alpha scales to zero, you have fewer and fewer hash buckets until the entire table is just one hash bucket with all values in a single list in that bucket, and so the average case converges to the linear-search worst case, or O(N).

    The average case is between O(1) and O(N), depending on alpha. We could express this as O(N^x), where x is a function that maps alpha = 0 to x = 1, and alpha = infinity to x = 0. So for the sake of debate, (see http://en.wikipedia.org/wiki/Heaviside_function), maybe something like O(N^(e^(-alpha))).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find out the average time it takes various pages of
How to find out average timestamp the field timestamp in a table gettime Timestamp
How can I find out which Service Pack is installed on my copy of
How can I find out which node in a tree list the context menu
How do I find out which process is listening on a TCP or UDP
I'm trying to find out a way to calculate the average color of the
I have been working on this code but I can't find out what is
I'm an average web developer. Just want to find out if it's advisable to
I need to find out the average of the values Columns 1 through 17
Problem:Given a comma separated string of numbers, want to find out the highest average

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.