title: Convert a binary tree to corresponding undirected graph
body: <p>Given a representation of a binary tree which can have the maximum of <strong>n</strong> nodes:</p>
  
  <pre><code>typedef struct node
  {
    int info,n;
    struct node *left,*right;
  }tree_node;
  </code></pre>
  
  <p>Construct an undirected graph from a binary tree which can have the maximum of <strong>n</strong> nodes.</p>
  
  <p>Graph is represented as a struct:</p>
  
  <pre><code>typedef struct
  {
    int n;
    tree_node *nodes[];
    int adjacency_m[][];
  }graph;
  </code></pre>
  
  <p>We can get a tree from graph by using algorithms like <strong>Prim</strong>, <strong>Kruskal</strong> or <strong>DFS</strong>. </p>
  
  <p><strong>Question:</strong> Is there an algorithm that creates a graph from a binary tree?
  For example, if binary tree is traversed in <strong>In-order</strong> fashion, then how to create an undirected graph from it? </p>