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


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: wrong output from binary search tree!!!!!!!!!

  1. #1
    Join Date
    Dec 2005
    Posts
    5

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

    Hi
    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
    Location
    San Bernardino County, California
    Posts
    1,468
    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, 07:58 PM
  2. Binary Tree Help
    By TheJVM_1970 in forum Java
    Replies: 2
    Last Post: 12-05-2005, 01:23 AM
  3. Serialization in Binary Tree
    By diva_thilak in forum Java
    Replies: 0
    Last Post: 02-21-2005, 04:47 AM
  4. Binary Search Tree implementation
    By Liza in forum Java
    Replies: 0
    Last Post: 10-23-2001, 12:21 PM
  5. Binary Search trees
    By Tom in forum Java
    Replies: 0
    Last Post: 12-02-2000, 01: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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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