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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:36:16+00:00 2026-05-29T15:36:16+00:00

Recently, I’m trying to solve all the exercises in CLRS. but there are some

  • 0

Recently, I’m trying to solve all the exercises in CLRS. but there are some of them i can’t figure out. Here is one of them, from CLRS exercise 12.4-2:

Describe a binary search tree on n nodes such that the average depth of a node in the tree is Θ(lg n) but the height of the tree is ω(lg n). Give an asymptotic upper bound on the height of an n-node binary search tree in which the average depth of a node is Θ(lg n).

Can anyone share some ideas or references to solve this problem? Thanks.

  • 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-29T15:36:18+00:00Added an answer on May 29, 2026 at 3:36 pm

    So let’s suppose that we build the tree this way: given n nodes, take f(n) nodes and set them aside. Then build a tree by building a perfect binary tree where the root has a left subtree that’s a perfect binary tree of n – f(n) – 1 nodes and a right subtree that’s a chain of length f(n). We’ll pick f(n) later.

    So what’s the average depth in the tree? Since we just want an asymptotic bound, let’s pick n such that n – f(n) – 1 is one less than a perfect power of two, say, 2^k – 1. In that case, the sum of the heights in this part of the tree is 1*2 + 2*3 + 4*4 + 8*5 + … + 2^(k-1) * k, which is (IIRC) about k 2^k, which is just about (n – f(n)) log (n – f(n)) by our choice of k. In the other part of the tree, the total depth is about f(n)^2. This means that the average path length is about ((n – f(n))log (n – f(n)) + f(n)^2) / n. Also, the height of the tree is f(n). So we want to maximize f(n) while keeping the average depth O(log n).

    To do this, we need to find f(n) such that

    1. n – f(n) = Θ(n), or the log term in the numerator disappears and the height isn’t logarithmic,
    2. f(n)^2 / n = O(log n), or the second term in the numerator gets too big.

    If you pick f(n) = Θ(sqrt(n log n)), I think that 1 and 2 are satisfied maximally. So I’d wager (though I could be totally wrong about this) that this is as good as you can get. You get a tree of height Θ(sqrt(n log n)) that has average depth Θ(Log n).

    Hope this helps! If my math is way off, please let me know. It’s late now and I haven’t done my usual double-checking. 🙂

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

Sidebar

Related Questions

Recently there was some upgrade happened from frame work 2.0 to 4.0, so after
Recently, I was asked to compile some of my Android projects, based on the
Recently I am making a server-client program using multithread concept. For some reason, I
Recently, when I tried to show the results of my work (some Flex app)
Recently I faced a issue when using len() in a query to find out
Recently I needed to add drag & drop functionality to a Silverlight application. Can
Recently there have been a lot of move towards MVVM framework due to the
Recently I've studied the backpropagation network and have done some manual exercise. After that,
Recently I tried to use /Wall Visual C++ option to enable all warnings and
Recently learning Android, there is a Handler class in android which is very useful.

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.