Last active
October 8, 2020 12:06
-
-
Save ampulhetadosaber/875485636019c070e4a3fa35b1e077c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
priority_queue<int> fila; | |
if(fila.empty()) // Aqui a fila está vazia, já que nada foi inserido ainda | |
{ | |
cout << "Vazia\n"; | |
} | |
fila.push(3); // A partir deste momento a fila não está mais vazia | |
// Então, fila.empty() retornará Falso | |
if(fila.empty()) // Como a fila não está vazia não entraremos nesse if | |
{ | |
cout << "Vazia\n"; | |
} | |
// Logo, o código so irá imprimir "Vazio" uma unica vez |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment