Many of the books are old and published before the first standard was out so it was probably hard to write good C++ books back then.
Well, I don't know about that. There should have been standard drafts they could have referred to. My personal "worst C++ book" (C++ in 21 days) was released in 1997, the same time "The C++ Programming Language" was released. And the latter is arguably still (one of) the best resources about C++ to this date.
Apart from not compiling this code, you can see that the author does not care about appropriate knowledge of operator new and about exceptions.
There are more questionable issues here . . .
1 2 3 4 5 6 7 8 9 10 11 12
void binarySearchTree::insert(node* &root, nodeValue new_value)
{
if (root == NULL)
{
root = new node(new_value, NULL, NULL);
if (!root)
throwfalse;
}
elseif (root->value > new_value)
insert(root->LChild, new_node);
else
insert(root->RChild, new_node);