mirror of
https://github.com/Fare-spec/cours.git
synced 2025-12-09 11:30:38 +00:00
tried to add dijkstra implementation
This commit is contained in:
21
tp6_enirely/TP6/Pile_List.py
Normal file
21
tp6_enirely/TP6/Pile_List.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from typing import Any
|
||||
|
||||
|
||||
def creer_pile_vide():
|
||||
return []
|
||||
|
||||
|
||||
def est_pile_vide(pile: list):
|
||||
return len(pile) == 0
|
||||
|
||||
|
||||
def sommet(pile: list):
|
||||
return pile[-1]
|
||||
|
||||
|
||||
def empiler(pile: list, element: Any):
|
||||
return pile + [element]
|
||||
|
||||
|
||||
def depiler(pile: list):
|
||||
return pile[:-1]
|
||||
Reference in New Issue
Block a user