A d-ary tree is a rooted tree in which each node has at most dchildren. Show that any d-ary tree with n nodes must have a depth ofΩ(lognlogd) .Can you give a precise formula for the minimum depth it could possibly have?

Short Answer

Expert verified

The depth of n node is equal to Ωlognlogd. Minimum depth of d-ary tree with n nodes is Ωlognlogd.

Step by step solution

01

Find the number of vertices and nodes

A d-ary tree is defined as a d-heap which is a priority queue data structure that contains dnumber of nodes in place of two nodes.

Assume that the difference between left and right subtree is not greater than 1 by height and every node is having d times more node than upper level.

So, number of vertices at level n is

V=dn

And number of nodes at depth is

H=dn

02

Calculate total number of nodes of the tree

Number of nodes at each level are:

Level1=1Level2=dLevel3=d2Level4=d3

Number of nodes at level h+1 is dh.

So, it forms a geometric series 1+d+d2+d3+...+dh

First element a by removing 1 from series is d.

Common ratio =d

Sum of the total nodes of the treedh+1-1d-1.

Let number of nodes in a tree is n.

Then,

dh+1=n×(d-1)+1d(h+1)3=n+1

Taking log on both sides: log(d(h+1)3)=log(n+1)

So, h3lognlogd . It is defined as h3Ωlognlogd

So, the depth of n node is equal to Ωlognlogd. Minimum depth of d-ary tree with n nodes isΩlognlogd .

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Consider an RSA key set with p = 17 , q = 23, N = 23 and e = 3 (as in Figure 1.9). What value of d should be used for the secret key? What is the encryption of the message M = 41 ?

Unlike a decreasing geometric series, the sum of the1,12,13,14,15,..... diverges; that is,i=1n1i=

It turns out that, for large n , the sum of the first n terms of this series can be well approximated as

i=1n1iInn+y

where is natural logarithm (log base e=2.718...) and y is a particular constant 0.57721...... Show that

i=1n1i=θ(logn)

(Hint: To show an upper bound, decrease each denominator to the next power of two. For a lower bound, increase each denominator to the next power of 2 .)

Show that if ab(modN)and if M Divides Nthenab(modM)

On page 38, we claimed that since about a 1nfraction of n-bit numbers are prime, on average it is sufficient to draw O(n)random n -bit numbers before hitting a prime. We now justify this rigorously. Suppose a particular coin has a probability p of coming up heads. How many times must you toss it, on average, before it comes up heads? (Hint: Method 1: start by showing that the correct expression isi=1i(1-p)i-1p . Method 2: if E is the average number of coin tosses, show that E=1+(1-p)E).

Consider the problem of computing x y for given integers x and y: we want the whole answer, not modulo a third integer. We know two algorithms for doing this: the iterative algorithm which performs y − 1 multiplications by x; and the recursive algorithm based on the binary expansion of y. Compare the time requirements of these two algorithms, assuming that the time to multiply an n-bit number by an m-bit number is O(mn).

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free