Comment utiliser la methode min(const _Tp& __a, const _Tp& __b, _Compare __comp)
Bonjour pour faire la rotation d'un arbre j'aurais besoin d'utiliser la fonction min(), cependant
il me renvoit une erreur
Citation:
Envoyé par Compilo
"In instantiation of const _Tp& minconst _Tp& __a, const _Tp& __b, _Compare __comp() with _Tp = int; _Compare = int"
"___comp cannot be used as a function"
mais je ne sais pas ce qu'est _comp, _Compare etc
voici le bout de code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Arbre* Arbre::rotG(Arbre * A)
{
Arbre * B = new Arbre();
int a,b;
B->R = A->R->getdroit();
//rotation
a = A->bal;
b = B->bal;
A->R->setdroit(B->R->getgauche());
B->R->setgauche(A->R);
A->bal = a-max(b,0)-1;
B->bal = min((a-2),(a+b-2),(b-1));
return B;
} |