This file contains hidden or 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
#include "bits/stdc++.h" | |
using namespace std; | |
class No{ | |
public: | |
No *dir, *esq; | |
int quantidade; | |
char letra; | |
No(No *dir,No *esq,int quantidade,char letra){ |
This file contains hidden or 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
#include<bits/stdc++.h> | |
using namespace std; | |
vector< vector<bool> > grafo,grafo2; | |
vector<int> valor; | |
stack<int> caminho; | |
int n,nivel=0,busca,total=0; | |
int getFilho(int pai){ | |
for(int cont=0;cont<n;cont++){ |
This file contains hidden or 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
#include "iostream" | |
#include "vector" | |
#include "stack" | |
using namespace std; | |
vector< vector<bool> > grafo; | |
vector<bool> visitado; | |
vector<int> valor; | |
stack<int> caminho; | |
int busca; |
This file contains hidden or 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
#include "iostream" | |
#include "vector" | |
using namespace std; | |
double max(vector<double> vetor){ | |
double maior= fila[0]; | |
for(short i = 1; i < fila.size(); i++){ | |
if(fila[i] > maior) | |
maior = fila[i]; |
This file contains hidden or 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
#include "iostream" | |
#include "vector" | |
#include "algorithm" | |
using namespace std; | |
int main(void){ | |
vector<double> fila = {1.8, 1.7, 1.6, 1.88, 1.9}; | |
sort(fila.begin(), fila.end()); | |
cout << fila.end() << endl; | |
This file contains hidden or 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
#include "iostream" | |
#include "vector" | |
using namespace std; | |
class Grafo{ | |
private: | |
// matrix de adjacencia | |
vector<vector<int>>matrixAdj; | |
public: | |
// constroi uma matrix quadrada nula |
This file contains hidden or 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
#include "iostream" | |
#include "vector" | |
using namespace std; | |
class Grafo{ | |
private: | |
// lista de aresta | |
struct aresta{ | |
unsigned x, y; | |
int valor; |
This file contains hidden or 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
#include "iostream" | |
#include "stack" | |
#include "vector" | |
using namespace std; | |
// matriz de adjacencia | |
vector< vector<int> > grafo; | |
// vertices visitados | |
vector<bool> visitado; |
This file contains hidden or 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
#include "bits/stdc++.h" | |
using namespace std; | |
// subsequencia comum mais longa Programacao Dinamica | |
int scml(string a, string b){ | |
// tabela programacao dinamica | |
vector < vector < int > > tabela; | |
// cria tabela | |
for (int cont = 0; cont < a.size() + 1; cont++) |
This file contains hidden or 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
#include "bits/stdc++.h" | |
using namespace std; | |
int qArestaAtual=0; | |
vector<vector<bool>> grafo; | |
vector<int> resultados; | |
stack<int> caminho; | |
set<pair<int,int>> visitado; | |
// verifica se a aresta foi visitada |
OlderNewer