binary tree

This is a discussion on binary tree within the C++ Programming forums, part of the General Programming Boards category; Hi! I have programmed a binary tree program, where the user can: 1)add a new element 2)delete an element 3)search ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    3

    Exclamation binary tree

    Hi!

    I have programmed a binary tree program, where the user can:

    1)add a new element
    2)delete an element
    3)search for an element
    4)output and input the tree a) in/from a file
    b) to/from the screen

    I have programmed it object oriented in 2 classes, that I have a class for the individual elements and one for the whole of the elements(for the tree). I want to know how I can ask if there is something in the file???
    for your answers please send me an e-mail(fatasli@gmx.at)
    thanks in advance

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    > I want to know how I can ask if there is something in the file
    You walk the tree.
    Since you had to walk the tree to add and delete stuff, search is just a walk the tree and compare each branch/leaf with what you're looking for.

    > for your answers please send me an e-mail(fatasli@gmx.at)
    That's not how message boards work - read replies here.
    If you want the board to tell you, tick the email notify box when you post.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 11-04-2006, 10:07 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21