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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:57:59+00:00 2026-05-15T20:57:59+00:00

I have been playing with the very cool btree applet at slady.net . I’m

  • 0

I have been playing with the very cool btree applet at slady.net. I’m having trouble understanding a particular behavior. Take a look at this starting state:

alt text http://www.freeimagehosting.net/uploads/db2931c7da.jpg

This particular state was arrived at by inserting the following sequence: 10, 15, 30, 16, 70, 1, 9, 27, 45, 50, 55.

My question is regarding what happens to the [45, ] node when I insert the next value in the sequence, 65.

alt text http://www.freeimagehosting.net/uploads/3b70c1d302.jpg

The [55,70] node will be split by the 65, and being the middle value, the 65 will travel back up and then split the [30,50] node as well. My question is: Why does the [45, ] node end up a child of the [30, ] node? It’s parent originally had 3 children, the left most and the right most became new seperate nodes. The 45 was between those values and it seems like it could have ended up under the [65, ] node just as well… Why?

  • 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-15T20:58:00+00:00Added an answer on May 15, 2026 at 8:58 pm

    A picture is worth a thousand words; an animation is worth a million:

    http://constellationmedia.com/~funsite/static/btree-insert-animation.gif

    The key thing to notice here is that when the center node 50 is pulled up, it has to throw away its right child because it’s too far down. However, 65 needs a new left child, so 50 hands 45 over to 65. 50 now needs a new right child, and the node containing 65 needs to be childed, so it takes the newly formed 65 in its place.

    Here are illustrated B-tree insertion rules (where maximum node size is 4 items, 5 child nodes):

    http://constellationmedia.com/~funsite/static/btree-insertion-rules.png

    The xr won’t exist and won’t matter if you’re inserting into a leaf (which you do first). However, if you have to split a node in half, the new x is the center item you pulled out, and the new xr is the right child of x.

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

Sidebar

Related Questions

I did a little GP (note:very little) work in college and have been playing
Thanks to a suggestion from Chas. Owens , I have been having fun playing
I have been playing around with JavaScript and Canvas for a while. Very often
Hi I have been playing around with MDX and need some very high-level getting-started
I have been playing around with a very simple HTML5/Canvas based drawing app, just
I have been playing around with MVC-Mini-Profiler, and found it very useful. However, on
I'm very new to javascript and have been playing around with regular expressions. I'm
Very new to Java and Swing, and I have been playing with a swing
i have been playing around with apache SOLR since last 3 weeks and very
I've been playing about with Azure ACS and its very cool and I think

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.