mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +00:00
Added type annotation for variables
This commit is contained in:
parent
5a87d4fe9e
commit
f80afa35a8
|
@ -1,14 +1,16 @@
|
||||||
import heapq
|
import heapq
|
||||||
|
from typing import Dict, List
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# First implementation of johnson algorithm
|
# First implementation of johnson algorithm
|
||||||
# Steps followed to implement this algorithm is given in the below link:
|
# Steps followed to implement this algorithm is given in the below link:
|
||||||
# https://brilliant.org/wiki/johnsons-algorithm/
|
# https://brilliant.org/wiki/johnsons-algorithm/
|
||||||
class JohnsonGraph:
|
class JohnsonGraph:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.edges = []
|
self.edges: List[str] = []
|
||||||
self.graph = {}
|
self.graph: Dict[str, int] = {}
|
||||||
|
|
||||||
# add vertices for a graph
|
# add vertices for a graph
|
||||||
def add_vertices(self, u) -> None:
|
def add_vertices(self, u) -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user