tdelete() example?

M

mbucc

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
 
E

Eric Sosman

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top