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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:12:48+00:00 2026-05-23T01:12:48+00:00

How would the adjacency matrix of binary tree of depth 4 in C look

  • 0

How would the adjacency matrix of binary tree of depth 4 in C look like? The depth of a node is defined as its distance from the root.

I know a is at depth zero e is at depth 2

             a
          /     \ 
         b       c
       / \      /  \ 
      d  e      f   g
    / \ / \    / \ / \ 
   h  i j k   l  m n  o



  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
  a b c d e f g h i j k l m n o
a   1 1 0 0 0 0 0 0 0 0 0 0 0 0
b 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0
c 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0
d 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0
e 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0
f 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0
g 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1
h 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
i 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 
j 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
k 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
l 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
m 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
n 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
o 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
  • 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-23T01:12:49+00:00Added an answer on May 23, 2026 at 1:12 am

    Just an observation. Holds true in general.

    If you have a complete binary tree, by which I mean all internal nodes have two children, and all leaves at same depth. And if you number them starting from 1
    i.e. in your case

    a = 1; b = 2; c = 3 ....
    

    For any node x -> i
    It’s children will be 2*i and 2*i + 1
    And it’s parent will be floor(i/2)

    In your case, you can just hard-code it since you have only depth = 4

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

Sidebar

Related Questions

Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
Would like someone to take a look at my script and tell me where
I have a 570 x 800 matrix with id values. What I would like
I would like to know how to measure the memory consumption of a graph
I would like to create a bread crumb from a path enumerated column. Here
I would like to remove some edges from a graph generated using Boost graph
I want to create a adjacency list using json object. I would like to
I would like to to sort the edge List of boost::graph defined as followed:
Is it possible to convert an adjacency matrix of ones and zeros as defined
Would it be possible to extract the following information from logs? Start up/Shut down

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.