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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:55:31+00:00 2026-06-13T20:55:31+00:00

This was a question from a data structures course at my university. I don’t

  • 0

This was a question from a data structures course at my university. I don’t understand what the question means. Can anybody elaborate me on the question, and the answer for it.

Suppose we insert all the numbers between 1 and 15 into an initially
empty binary search tree; all permutations of these keys are equally
likely to be the insertion order. Compute the probability of the
resulting tree having 10 as its root, 7 as the left child of the root
and 15 as the right child of the root.

  • 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-13T20:55:33+00:00Added an answer on June 13, 2026 at 8:55 pm

    In order for “10 as its root, 7 as the left child of the root and 15 as the right child of the root.” to happen, the insertion order for the tree must be either:

    • 10 first, then 7, then 15, then the other 12 numbers in some order.
    • 10 first, then 15, then 7, then the other 12 numbers in some order.

    Now consider: how many ways that can happen?

    • 1 way to first choose 10, then choose 7, then choose 15; and 12! ways to choose the rest.
    • 1 way to first choose 10, then choose 15, then choose 7; and again 12! ways to choose the rest.

    So that’s (12! * 2) ways to end up with that particular arrangement.

    Now, the set of all possible insertion orders is the permutation of 15 numbers, which is 15! (factorial)

    Note that the question says “all permutations of these keys are equally likely to be the insertion order“, so it’s concerned with the number of possible ways to construct the tree, not the actual number of distinct resultant trees (there is a difference, because different insertion orders may yet end up building the same tree (e.g. the 2 cases above minus the 12 other numbers would build the same tree despite different insertion orders)

    Probability is: (The number of ways to build the arrangement specified by the question) divided by (the total number of possible ways to build the tree):

    So (12! * 2) / (15!) is the probability you want.

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

Sidebar

Related Questions

Check this example before reading the question - http://www.sqlfiddle.com/#!2/fcf3e/8 The following data comes from
This question arose from the discussion in the comments of this answer . First,
This specific questions stems from the attempt to handle large data sets produced by
This is a continuation of this question from yesterday . Here are my three
I got this question from my cousin: What will be the best way to
Unfortunately I am not writing this question from my Developing PC so I might
This question results from hours of googling highstocks, zoom, extremes, ranges, and every other
This question stems from Hartl's Rails Tutorial (progressed in chapter 9) - sorry if
This question originates from a discussion on whether to use SQL ranking functionality or
My question originates from this question, where one of the comments suggests that a

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.