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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:17:17+00:00 2026-06-18T22:17:17+00:00

I’m trying to understand a simple concept regarding heaps. I know that BuildHeap using

  • 0

I’m trying to understand a simple concept regarding heaps.

I know that BuildHeap using Floyd algorithm takes Theta(n) to build a heap of size n. The way we get this running time is by building the heap from bottom up – in this way the larger quantity of heap do less work.

I had an exerecise about this concept but with one different detail, the question was the following :

“Suppose the known ‘FixHeap’ takes Theta(log(log(n)) instead of
Theta(log(n)). What will be the running time of the BuildHeap
algorithm to build a max heap of size N using the new ‘FixHeap’
algorithm(the one which takes now only Theta(log(log(n)))”

I don’t understand how the running time of the new given FixHeap affects the overall algorithm running time. Can you please help me to understand what the changes will be?

The FixHeap is the known algorithm which compares the parent to its left and right child and put the largest value in the parent. FixHeap on a vertex which is the parent of a leaf will do maximum one replacement, and the parent of this vertex might do two replacement and so on..

EDIT : The current BuildHeap running time is calculated by the following expression:

(n/4) * 1 + (n/2) * 2 + (n/3) * 3 +……+ 1 * logn-1

Just because there are n/4 parent of the leaves which do 1 change at maximum, and there are n/2 which do 2 changes at maximum and so on…

I just can’t see the change in the formula now.

Thank you!

  • 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-18T22:17:18+00:00Added an answer on June 18, 2026 at 10:17 pm

    This algorithm will still take Θ(n) time. To see this, we can show that the algorithm is O(n) and Ω(n).

    For the O(n) part, note that this algorithm clearly can’t be any asymptotically slower than the version in which FixHeap takes O(log n) time each. Since the heapify algorithm takes O(n) time in that second case, we can get an O(n) time bound for the O(log log n) time case as well.

    For the Ω(n) part, note that the heapify algorithm works by executing the FixHeap procedure once for each element in the first half of the array. It takes at least Ω(n) time to iterate over half of an n-element array, giving us the lower bound we need.

    Hope this helps!

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
Basically, what I'm trying to create is a page of div tags, each has

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.