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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:51:35+00:00 2026-06-11T09:51:35+00:00

Well normally if using depth-first traversal, we get O(n) time. However, if we find

  • 0

Well normally if using depth-first traversal, we get O(n) time. However, if we find the minimum element first then call the successor() method n times, what time complexity will it be?

I think it may be O(n log n) because successor is O(log n) but that doesn’t seem right. Can anyone offer any in-depth analysis here (probably involving some limit analysis)?

  • 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-11T09:51:36+00:00Added an answer on June 11, 2026 at 9:51 am

    If parent pointers are present at each node, calling the successor method n times takes O(n) time. To see this observe that each edge in the tree gets visited at most twice (once from parent to child and once from child to the parent) by all the successor calls combined. Thus the total number of edges visited by all the successor calls is at most 2n. So the running time is O(n).

    Now if parent pointers are not present, in every call we have to start from the root and search for the successor element by travelling through O(log n) nodes (if the tree is balanced). So the complexity becomes O(n log n).

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

Sidebar

Related Questions

I have a long-standing application that I'm normally able to compile equally well from
I'm using the Django Message Framework to show messages to users as well as
I am writing a Desktop GUI application in Clojure using Java Swing. Normally when
To use your own ModelMetadataProvider you normally set it in the global.asax. I'm using
Normally getting an unconstructed generic type is quite easy, using typeof : Type genericType
Most of the time when we use Rhino mocks it works well, but we
Question is pretty well stated in the title. Normally I would use <link... />
Well, this is not really a problem, but something really interests me. Normally we
My friend has been using abobe flash for a while now, and said normally
I am using a Datagrid with several columns of data (call it myDG) and

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.