Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int gradoSalida(TGrafo* grafo,TElemento v){
- int cont = 0;
- if (existeVertice(grafo,v)){
- TNodoVertice* ptrRecVertice;
- ptrRecVertice = grafo->inicio;
- while(ptrRecVertice->elem != v)
- ptrRecVertice = ptrRecVertice->ptrSig;
- TNodoArista* ptrRecArista;
- ptrRecArista = ptrRecVertice->inicio;
- while(ptrRecArista){
- cont++;
- ptrRecArista = ptrRecArista->ptrSig;
- }
- }
- return cont;
- }
- int gradoEntrada(TGrafo*grafo,TElemento v){
- int cont = 0;
- if(existeVertice(grafo,v)){
- TNodoVertice *ptrRecVertice;
- TNodoArista *ptrRecArista;
- ptrRecVertice = grafo->inicio;
- while(ptrRecVertice){
- ptrRecArista = ptrRecVertice->inicio;
- while(ptrRecArista){
- if(ptrRecArista->elem == v)
- cont++;
- ptrRecArista = ptrRecArista->ptrSig;
- }
- ptrRecVertice = ptrRecVertice->ptrSig;
- }
- }
- return cont;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement