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

  • Home
  • SEARCH
  • 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 8458857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:11:32+00:00 2026-06-10T13:11:32+00:00

I was doing a program to compare the average and maximum accesses required for

  • 0

I was doing a program to compare the average and maximum accesses required for linear probing, quadratic probing and separate chaining in hash table.

I had done the element insertion part for 3 cases. While finding the element from hash table, I need to have a limit for ending the searching.
In the case of separate chaining, I can stop when next pointer is null.
For linear probing, I can stop when probed the whole table (ie size of table).
What should I use as limit in quadratic probing? Will table size do?

My quadratic probing function is like this

newKey = (key + i*i) % size;

where i varies from 0 to infinity. Please help me..

  • 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-06-10T13:11:33+00:00Added an answer on June 10, 2026 at 1:11 pm

    For such problems analyse the growth of i in two pieces:

    First Interval : i goes from 0 to size-1

    In this case, I haven’t got the solution for now. Hopefully will update.

    Second Interval : i goes from size to infinity

    In this case i can be expressed as i = size + k, then

    newKey = (key + i*i) % size 
           = (key + (size+k)*(size+k)) % size
           = (key + size*size + 2*k*size + k*k) % size
           = (key + k*k) % size
    

    So it’s sure that we will start probing previously probed cells, after i reaches to size. So you only need to consider the situation where i goes from 0 to size-1. Because rest is only the same story again and again.

    What the story tells up to now: A simple analysis showed me that I need to probe at most size times because beyond size times I started probing the same cells.

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

Sidebar

Related Questions

I'm doing my program in many steps. One of them is to use gevent
I am doing my program in cocos2d. I am using NSDate to get the
I am doing a recursive program and I am getting an error about conflicting
I'm doing a small program with sencha touch. I deployed it on my webserver
I am doing a minesweeper program for school, but i keep getting this error
i, I have to run about a 100 tests on my program and doing
This program I'm doing is about a social network, which means there are users
While doing some random experimentation with a factorial program in C, Python and Scheme.
I am doing a simple JSP program to connect with MySQL DB. But it's
I am basically doing a tutorial but my program seems to have errors that

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.