OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Can someone explain how to solve this? [closed]

  • Thread starter Thread starter Yury Stepovikov
  • Start date Start date
Y

Yury Stepovikov

Guest
Given a string representation of a tree: (1 (2 (4 5 6 (7) 108 (9)) 3))

The question is: how do I parse this string into a tree representation?

Code:
 1---+
     2---+
     |   4
     |   5
     |   6-----+
     |   |     7
     |   108---+
     |         9
     3

I'm not sure which algorithm to use here.

<p>Given a string representation of a tree: (1 (2 (4 5 6 (7) 108 (9)) 3))</p>
<p>The question is: how do I parse this string into a tree representation?</p>
<pre><code> 1---+
2---+
| 4
| 5
| 6-----+
| | 7
| 108---+
| 9
3
</code></pre>
<p>I'm not sure which algorithm to use here.</p>
 

Latest posts

Top