以下の15行目でポインタ変数*tempを使用して新しいNodeオブジェクトを作成しようとすると、セグメンテーション違反が発生します。私はまだc++と、特に&と組み合わせて使用した場合のダブルポインターのしくみにかなり慣れていません。助けてくれてありがとう。
void bst::insert(int n) {
Node **temp;
Node *r, *parent;
// Tree is empty
if (root == NULL) {
root = new Node;
root->parent = NULL;
root->value = n;
root->left = NULL;
root->right = NULL;
root->isBlack = true;
} else {
r = root;
// Create a node with the given value, n
(*temp) = new Node;
(*temp)->value = n;
(*temp)->left = NULL;
(*temp)->right = NULL;
(*temp)->isBlack = false;