Welcome to perlmonks,
As usually stated in those case, this is not an online code writing service.

What have you tried? If you post a bit of code or at least your ideas on how you would go about it (what perl built in structure you might use) you might get help!

So before you hit google with "binary tree implementation" you might as well have a look at this if you feel in an array using mood
You might also implement your tree as a serie of hash data structures with references to each other
Update:
as explained in the link above, after the second node has been added you just recursively use the same action to add new nodes:

Is that value bigger than the first node?
then recurse right
else recurse left
and so on.
When updating the tree you add references to the new values that way they are not lost, that means that once you have found a place for the new value in your tree you update the new node's father with a reference to his child (here in left or right field)

Update 2
Just to be clear, when I say recurse I mean, call the function inside itself, using recursion that is. If you understand the concept that kind of data structure becomes much easier to handle


In reply to Re: How do I create a binary tree ? by QuillMeantTen
in thread How do I create a binary tree ? by punitpawar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.