Thread: Sorted binary tree

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    1,658
    I don't know why leading spaces on the first line are ignored by code (unless the view is changed to plain text), but to get around that issue, I use a dummy first line:

    Code:
    .......
       4
     2   6
    1 3 5 7

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Quote Originally Posted by rcgldr View Post
    I don't know why leading spaces on the first line are ignored by code (unless the view is changed to plain text), but to get around that issue, I use a dummy first line:

    Code:
    .......
       4
     2   6
    1 3 5 7
    You just have to make sure there's a character in the very first spot:

    Code:
    .  4
     2   6
    1 3 5 7

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary search on a sorted list
    By littlefermat245 in forum C Programming
    Replies: 13
    Last Post: 01-25-2010, 03:49 AM
  2. Inserting value to a sorted binary tree?
    By HappySmileMan in forum C Programming
    Replies: 3
    Last Post: 02-15-2009, 09:34 AM
  3. Replies: 2
    Last Post: 08-01-2007, 01:08 PM
  4. display tree data in binary tree format
    By xddxogm3 in forum C++ Programming
    Replies: 4
    Last Post: 12-11-2003, 12:47 AM
  5. Building a Binary Search Tree off sorted data
    By BlackCitan in forum C Programming
    Replies: 0
    Last Post: 12-01-2003, 09:52 PM