We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  • Hiring developers?
  1. Practice
  2. Data Structures
  3. Trees
  4. Tree : Top View
  5. Discussions

Tree : Top View

  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

    You are viewing a single comment's thread. Return to all comments →

  • niranjan_wad 2 years ago+ 5 comments

    same question.. Expected output: 1 2 47 49 50 My output: 47 2 1 49 50

    1|
    ParentPermalink
    • archidsouza18 2 years ago+ 1 comment

      @niranjan_wad how did you manage to find the output? Since, it does not tell what is your output. do you know what is root of above question ?

      -1|
      ParentPermalink
      • BarryB 2 years ago+ 0 comments

        If you hover of the submission results that failed, there will be a popup that appears, where you can download both the input and expected output for that test case.

        -3|
        ParentPermalink
    • bennattj 2 years ago+ 0 comments

      You appear to have the correct output, but in the wrong order. The solution wants it "left-to-right" (which just so happens to be least-to-greatest since these are apparently binary search trees).

      1|
      ParentPermalink
    • 15A31A0566 11 months ago+ 0 comments

      Try using TreeMap so the keys will be in sorted order

      0|
      ParentPermalink
    • Sumitkush677 9 months ago+ 0 comments

      bro..first print traverse, then print that node. then u get correct order

      0|
      ParentPermalink
    • Sumitkush677 9 months ago+ 0 comments

      first traverse,the print that node. u get correct order

      0|
      ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature