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

The Archive Base Latest Questions

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

I know that from a general tree you can construct a unique binary tree,

  • 0

I know that from a general tree you can construct a unique binary tree, but is the reverse true? i.e can you get a unique general tree from a binary 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-06-13T06:31:18+00:00Added an answer on June 13, 2026 at 6:31 am

    Yes. The following transformation is reversible:

    Given a general tree with ordered but not indexed children,
    encode the first child as the left child of its parent, and each other node as a right child of its (former) sibling.

    The reverse is:
    Given a binary tree with distinguished left and right children, read the left child of a node as its first child and the right child as its next sibling.

    So, the following tree

      a
     /|\
    b c d
    

    is encoded as

      a
     /
    b
     \
      c
       \
        d
    

    while the following tree

       a
      / \
     b   c
     |
     d
    

    is encoded as

         a
        /
       b
      / \
     d   c
    

    (read: d is the first child of b, c is the sibling of a).

    Note that you can encode any rooted forest (with ordered components, otherwise the representation is not unique) by assigning a sibling to the root, so this

      a
     / \
    b   c
     \   \
      d   e
    

    would be read as

      a   c e
     / \
    b   d
    

    here is another method to get a unique general (undirected) tree from a binary tree:

    • a vertex binary tree may have 0…3 graph neighbors.
    • append 12 nodes to the root
    • append 8 nodes to each left child
    • append 4 nodes to each right child

    this operation is reversible:

    • label the node with at least 12 neighbors “root”. If not unique, fail.
    • label each node with 8..11 neighbors “left”.
    • label each node with 4..7 neighbors “right”.
    • remove all leaves
    • orient all edges away from the root
    • if any node has more than one left child or more than one right child, fail.

    So,

    • There is a bijection between ordered rooted trees and binary trees (first and second algorithm).
    • Since any general tree can be arbitrarily rooted, there is a injection from general (directed or undirected) trees to binary trees.
    • There is an injection from binary trees to general undirected trees (third algorithm)
    • Since there is an injection from binary trees to general trees and back, there must exist a bijection between general (directed or undirected) trees and binary trees.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that in J2ME I can get a byte[] object from a String
I know that I can get a POSIX int file handle from NSURL by
I know that such general questions shouldn't be asked, but can someone help me
We know that malloc() and new operation allocate memory from heap dynamically, but where
I know that I can run an external Javascript file from within HTML with
I know that casting can really only be done from a sub class to
I know that the general consensus is to use one or the other, but
OK, so I know that from-import is exactly the same as import , except
I know that in OOP you want every object (from a class) to be
I know that it's bad to run any kind of GUI widget from within

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.