tdelete() example?

Discussion in 'C Programming' started by mbucc, Jun 7, 2010.

  1. mbucc

    mbucc Guest

    Hi,

    I'm having a hard time finding a code
    example that shows how to delete a
    binary tree that was created with tsearch().

    I'd prefer not to use the tdestroy() GNU
    extension and twalk() says not to change
    the tree while you are walking it.

    OpenBSD man page say pass root node
    to tdelete() and you get new root node
    back, but I can't tell for sure if that will
    work on GNU/Linux as well.

    I hope this is the right list for this
    question.

    Thanks,

    Mark
     
    mbucc, Jun 7, 2010
    #1
    1. Advertising

  2. mbucc

    Eric Sosman Guest

    On 6/7/2010 3:42 PM, mbucc wrote:
    > Hi,
    >
    > I'm having a hard time finding a code
    > example that shows how to delete a
    > binary tree that was created with tsearch().
    >
    > [...]
    >
    > I hope this is the right list for this
    > question.


    Unfortunately, it's not, as tdelete() and related functions
    are not part of the Standard C library (they appear to be POSIX
    and/or Unix and/or X/Open utilities).

    There's some example code on the OpenGroup site

    http://www.opengroup.org/onlinepubs/009695399/functions/tfind.html

    .... but I think questions about usage and portability probably
    belong on comp.unix.programmer, or a Linux forum if you're interested
    in (or concerned about) Linux extensions/differences.

    --
    Eric Sosman
    lid
     
    Eric Sosman, Jun 7, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bright
    Replies:
    1
    Views:
    544
  2. Timo Dammes
    Replies:
    2
    Views:
    6,521
    Elliot Schei
    Jun 11, 2004
  3. bob

    Shift register example?

    bob, Feb 18, 2005, in forum: VHDL
    Replies:
    1
    Views:
    3,250
    Ralf Hildebrandt
    Feb 18, 2005
  4. Sam Roberts
    Replies:
    15
    Views:
    302
    Sam Roberts
    Feb 7, 2005
  5. Ivan Shmakov

    search.h: tdelete ()?

    Ivan Shmakov, May 30, 2013, in forum: C Programming
    Replies:
    5
    Views:
    199
    Ivan Shmakov
    May 30, 2013
Loading...

Share This Page