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

  • Home
  • SEARCH
  • 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 3237850
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:47:11+00:00 2026-05-17T17:47:11+00:00

Say I have a B-Tree with nodes in a 3-4 configuration (3 elements and

  • 0

Say I have a B-Tree with nodes in a 3-4 configuration (3 elements and 4 pointers). Assuming I build up my tree legally according to the rules, is it possible for me to reach a situation where there are two nodes in a layer and one node has 4 exiting pointers and the other has only two exiting pointers?

In general, what guarantees do I have as to the balancedness of a properly used B-Tree

  • 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-17T17:47:12+00:00Added an answer on May 17, 2026 at 5:47 pm

    The idea behind balance (in general balanced tree data structures) is that the difference in depths between any two sub-trees is zero or one (depending on the tree). In other words, the number of comparisons used to find a leaf node is always similar.

    So yes, you can end up in the situation you describe, simply because the depths are the same. The number of elements in each node is not a concern to the balance (but see below).

    This is perfectly legal even though there’s more items in the left node than the right (null pointers are not shown):

                     +---+---+---+
                     | 8 |   |   |
                     +---+---+---+
            ________/    |
           /             |
          |              |
    +---+---+---+  +---+---+---+
    | 1 | 2 | 3 |  | 9 |   |   |
    +---+---+---+  +---+---+---+
    

    However, it’s very unusual to have a 3-4 BTree (some would actually say that’s not a BTree at all, but some other data structure).

    With BTrees, you usually have an even number of keys as maximum in each node (e.g., a 4-5 tree) so that the splitting and combining is easier. With a 4-5 tree, the decision as to which key is promoted when a node fills up is easy – it’s the middle one of the five. That’s not such a clear-cut matter with a 3-4 tree since it could be one of two (there is no definite middle for four elements).

    It also allows you to follow the rule that your nodes should contain between n and 2n elements. In addition (for “proper” BTrees), the leaf nodes are all at the same depth, not just within one of each other.

    If you added the following values to an empty BTree, you could end up with the situation you describe:

    Add           Tree Structure
    ---          ----------------
     1                  1
    
     2                 1,2
    
     5                1,2,5
    
     6               1,2,5,6
    
     7                  5
                       / \
                    1,2   6,7
    
     8                  5
                       / \
                    1,2   6,7,8
    
     9                  5
                       / \
                    1,2   6,7,8,9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have my sources in my src/ tree (and possibly in my test/
If I have a form-backing object that has a complicated object tree -- say
I have an own Tree object implemented in PHP. Say we have a tree
lets say i have a tree of the following structure: <div>node level1 <div>node level2
Let's say I have a recursive data structure class Tree { private Tree right;
Let's say I have an acyclic directed graph such as a family tree (not
Say I have a html object tree as follows: <div> <p>Text 1</p> <p>Text 2</p>
Let's say you have a tree structure as follows: a [Level 0] / |
Say I have a graph (network) of nodes, with weightings on the following: 1.
i have created the tree with its nodes and i would like to put

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.