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
set number | |
set mouse=a | |
set numberwidth=1 | |
set clipboard=unnamed | |
syntax enable | |
set showcmd | |
set ruler | |
set encoding=utf-8 | |
set showmatch | |
set sw=2 |
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
from heapq import heappush, heappop | |
def shortestPath(graph): | |
# Crea un diccionario para almacenar las distancias de los nodos desde "A" | |
distances = {} | |
# Crea una cola de prioridad que almacenará las distancias y nodos visitados | |
queue = [(0, 'A')] | |
# Mientras la cola no esté vacía, seguirá buscando el camino más corto |
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
import tkinter as tk | |
import tkinter.font as tkFont | |
class Queue: | |
def __init__(self): | |
self.items = [] | |
def is_empty(self): | |
return not self.items |