Skip to content

Commit

Permalink
fix [ListTools/main]: ponteiro->topo
Browse files Browse the repository at this point in the history
- Quando a pilha tinha dois nodos, topo não era atualizado.
  • Loading branch information
Fernandoakafox committed Nov 21, 2023
1 parent 48ae06f commit a38fb41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ListTools.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void push(struct Pilha **head, int vertice){
no->vertice = vertice;
if((*head)->topo == NULL){
no->prox = NULL;
(*head)->topo = no;
}else{
no->prox = (*head)->topo;
(*head)->topo = no;
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main (){


struct Pilha *dijkstraRoute = dijkstra(grafo, 0, 3);
//printf("TOPO: %i\n", dijkstraRoute->topo->vertice); // O bug parece ser com a pilha
printf("TOPO: %i\n", dijkstraRoute->topo->vertice); // O bug parece ser com a pilha

plot_route(&dijkstraRoute, grafo);
}

0 comments on commit a38fb41

Please sign in to comment.