Details
- Reviewers
wblock will - Group Reviewers
manpages - Commits
- rS320992: Add a complete example to tsearch(3)
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
head/lib/libc/stdlib/tsearch.3 | ||
---|---|---|
134–140 | I find the paragraph to be quite difficult to parse in one pass. "The following example takes in four strings and compares each one of them against each other before adding them to the tree. The fourth string is added a second time. tfind is used to verify that a duplicate is not added and tdelete is used to remove it" question, is the it on the end of the sentence referring to a duplicate or any entry that's been added? |
head/lib/libc/stdlib/tsearch.3 | ||
---|---|---|
134–140 | I agree with sevan, I've had problems understanding that paragraph (refrained from commenting since he already had :-). The suggested re-wording sounds like an improvement. The rest looks good! |
head/lib/libc/stdlib/tsearch.3 | ||
---|---|---|
134–140 | Hm. The example code is... not overly clear. But maybe this describes it? This example uses .Fn tsearch to search for four strings in .Dv root . Because the strings are not already present, they are added. .Fn tsearch is called twice on the fourth string to demonstrate that a string is not added when it is already present. .Fn tfind is used to find the single instance of the fourth string, and .Fn tdelete removes it. Finally, .Fn twalk is used to return and display the resulting binary search tree. |