Re: free binary search tree

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joachim Schipper
Date: Monday, June 7, 2010 - 2:20 pm

On Mon, Jun 07, 2010 at 05:02:09PM -0400, Mark Bucciarelli wrote:

Can't you just do

    while (rootp != NULL)
        tdelete(rootp, &rootp, compar);

where, of course, compar() must be defined as usual for the tree
routines?

Note that the macros in sys/tree.h, which are available under the
liberal ISC (BSD) license and documented in tree(3), are usually
preferable to tsearch() and friends.

		Joachim
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
free binary search tree, Mark Bucciarelli, (Mon Jun 7, 2:02 pm)
Re: free binary search tree, Joachim Schipper, (Mon Jun 7, 2:20 pm)
Re: free binary search tree, Bret S. Lambert, (Mon Jun 7, 2:21 pm)