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 7919343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:50:02+00:00 2026-06-03T15:50:02+00:00

In Skiena’s book of algorithm design , given that the hash table has can

  • 0

In Skiena’s book of algorithm design, given that the hash table has can have maximum m buckets and total number of elements is n, the following worse case time complexities are observed:

Search: O(n)

Successor: O(n + m)

Why are the two different? Doesn’t finding successor also in a way involve searching the next element?

  • 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-03T15:50:04+00:00Added an answer on June 3, 2026 at 3:50 pm

    Hashing achieves constant-time search at the cost of destroying order. When I search for an element, I hash it (O(1)) and look in the chosen bucket (O(n) in the worst case if I scan linearly, as all the other buckets might be empty.)

    When I want the next element after a given one, I have no guarantee that it will be in the same bucket. In fact I have no knowledge about where it is at all. Since I do not know what the successor is yet, I can’t hash it to find its bucket. Instead I am forced to look in each bucket (O(m).)

    If I probe items in order when scanning a bucket, I end up also doing a total of linear work in the number of items (O(n)). This results in a total complexity of O(n + m).

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

Sidebar

Related Questions

In the book The Algorithm Design Manual by Skiena, computing the mode (most frequent
Skiena's book on Algorithm contains the following question: 1) Evaluate expression given as binary
I've been going through Skiena's excellent The Algorithm Design Manual and got hung up
I'm going through Skiena's The Algorithm Design Manual which uses C. All the examples
Such algorithm was left as an exercise to the reader in Skiena's algorithm design
Hello Developers! I am learning algorithms from Algorithms Design Manual Book by Skiena. There
I'm re-reading Skiena's Algorithm Design Manual to catch up on some stuff I've forgotten
I have recently started reading Programming Challenges book by S. Skiena and believe or
A question from Skiena's book of algorithm: Suppose G is a connected undirected graph.
Got this question from algorithms design manual by Steven Skiena. It is required to

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.