DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005

    wrong output from binary search tree!!!!!!!!!

    Ihave constructed a binary search tree and then insert it following four items. then I want to print tree in preorder form. in my output file there is extra things as below.
    for example
    i want this
    int float mytype itisatype
    but output is
    int float mytype itisatype 0xbffff8ac
    why do I have these extra characters?

    if there is someone who has any idea about this problem ,please help me.

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    Your traversal is outputting 5 times - one appears to be a memory address. Can't do much debugging without code ... have you actually added 5 nodes? is your preorder traversal printing five times instead of four?

Similar Threads

  1. Replies: 4
    Last Post: 12-05-2005, 06:58 PM
  2. Binary Tree Help
    By TheJVM_1970 in forum Java
    Replies: 2
    Last Post: 12-05-2005, 12:23 AM
  3. Serialization in Binary Tree
    By diva_thilak in forum Java
    Replies: 0
    Last Post: 02-21-2005, 03:47 AM
  4. Binary Search Tree implementation
    By Liza in forum Java
    Replies: 0
    Last Post: 10-23-2001, 11:21 AM
  5. Binary Search trees
    By Tom in forum Java
    Replies: 0
    Last Post: 12-02-2000, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.