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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:53:59+00:00 2026-05-24T02:53:59+00:00

I am reading data structures in C and C++ by Tannenbaum. Following is text

  • 0

I am reading data structures in C and C++ by Tannenbaum. Following is text snippet from the book

Non-leaf nodes are called internal nodes and leaves are called external
nodes. This terminology is often used when only single type of node is
defined. Of course, a son pointer within an internal node must be
identified as pointing to an internal and external node. This can be
done in two ways:

  1. one technique is to declare two different node types and pointer
    types and to use a union for internal nodes with each alternative
    containing one of the two pointer types.
  2. Other technique is to retain a single type of pointer and a single
    type of node, where the node is a union that does (if the node is an
    internal node) or does not (if an external node) containing left and
    right pointer fields.

My questions are

(A) What does author mean a son pointer within an internal node?

(B) can any one define example structure for two techniques in C to understand the statements?

Thanks!

  • 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-24T02:54:02+00:00Added an answer on May 24, 2026 at 2:54 am

    What does author mean a son pointer within an internal node?

    I suppose the text is about a data structure called a tree. One of the approaches to building such a structure is defining a C structure (sic!) as follows:

    struct Node {
        int someData;
        struct Node *left, *right;
    };
    

    So the son pointers the author is referring to are these left and right fields having pointer types. They are more often called child pointers though.

    can any one define example structure for two techniques in C to understand the statements?

    Here are they.

    (1)

    struct InternalNode;
    struct ExternalNode;
    
    union ChildPointer {
        struct InternalNode *asInternal;
        struct ExternalNode *asExternal;
    };
    
    struct InternalNode {
        // Some data here
    
        union ChildPointer left, right;
    };
    
    struct ExternalNode {
        // External node data here
    };
    

    However, I’m not going to explain how to know in advance whether node’s left child is an internal or external node, probably it should be known by the internal state, or maybe there’s only one instance of the ExternalNode structure, to which all the non-leaf nodes link and the direct comparison is possible, maybe someone could advise.

    (2)

    union Node;
    struct InternalData {
        // Internal node data here
    
        union Node *left, *right;
    };
    
    struct ExternalData {
        // External node data here
    };
    
    union Node {
        struct InternalData internal;
        struct ExternalData external;
    };
    

    This can be made a lot more convenient using anonymous structs/unions, but this is an ms-extension to C.

    This can be theoretically meaningful only if you’re trying to save some bits of memory on leaf nodes that doesn’t contain data or some more memory if they do need some extra memory which is not needed by internal nodes.

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

Sidebar

Related Questions

I was reading over my text book Data Structures and Algorithms: By Mark Allen
I'm reading Data structures and algorithms from Aho, Hopcroft & Ullman, and I'm confused
I'm reading a book about data structures in java, and it's talking about iterators
I was reading an older data-structures book and it said that when you're doing
I am reading a book on data structures and it says that a left
I am reading a chapter on trees in book on Data structures and Algorithms
while reading the chapter on basic operations on sets from the book of data
When reading data from the Input file I noticed that the ¥ symbom was
I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query.
I'm reading data from a device which measures distance. My sample rate is high

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.