/    Sign up×
Community /Pin to ProfileBookmark

Binary Tree Node Representation

I have been looking at code associated with sorted Binary Trees and have a question.
In every example I have found the Node is represented either by an integer number or an alphabetic letter.
The descriptions of the code use the node values to decide if the children go to the left or right.
Examples:

“`
(Alignment may not be perfect)
15
/
10 25
/ /
13 22 27 30
/ /
5 9 17

A
/
B C
/ /
D E F G
“`

Where left or right points to next Node or a ‘null’ pointer value

Here are the questions I have based upon my review of the information I have found:

  • 1.

    a. Do the Node values represent numeric entries like ’employee ID’ or ‘SSN’ values?
    or b. Do the Node values represent name entries like ‘last name’ or ‘product’ values?

  • 2.

    Do you think of the Node value as a key to additional information associated with the node?
    For example, should the Node represent a key to an object with associated information for the key?

  • 3.

    Are the node values ever mixed, such that both numbers and letters are used as Node values
    in the same object, or are they exclusive as in numbers only and letters only?

  • 4.

    What are some typical Node assignments for a typical Binary Search database?
    Where is the practical information stored in a typical application?
    Just single numbers/letters Node look-ups don’t seem to have much practical use.

  • I seem to have a missing link in my understanding of the structure and use of the Binary Tree.
    Any information or links to help enlighten me would be much appreciated.

    to post a comment
    JavaScript

    0Be the first to comment 😎

    ×

    Success!

    Help @JMRKER spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.25,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...