From 579250363db1975440c75f4f6d486b88ff568cdb Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Thu, 26 Oct 2023 08:36:53 -0400 Subject: [PATCH] Speed up `dijkstra_bankers_algorithm.py` (#10861) * updating DIRECTORY.md * Rename dijkstra_bankers_algorithm.py * Remove sleep() call * updating DIRECTORY.md --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> --- DIRECTORY.md | 2 +- other/{dijkstra_bankers_algorithm.py => bankers_algorithm.py} | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) rename other/{dijkstra_bankers_algorithm.py => bankers_algorithm.py} (99%) diff --git a/DIRECTORY.md b/DIRECTORY.md index 5f8eabb6d..d108acf8d 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -774,8 +774,8 @@ ## Other * [Activity Selection](other/activity_selection.py) * [Alternative List Arrange](other/alternative_list_arrange.py) + * [Bankers Algorithm](other/bankers_algorithm.py) * [Davis Putnam Logemann Loveland](other/davis_putnam_logemann_loveland.py) - * [Dijkstra Bankers Algorithm](other/dijkstra_bankers_algorithm.py) * [Doomsday](other/doomsday.py) * [Fischer Yates Shuffle](other/fischer_yates_shuffle.py) * [Gauss Easter](other/gauss_easter.py) diff --git a/other/dijkstra_bankers_algorithm.py b/other/bankers_algorithm.py similarity index 99% rename from other/dijkstra_bankers_algorithm.py rename to other/bankers_algorithm.py index be7bceba1..858eb0b2c 100644 --- a/other/dijkstra_bankers_algorithm.py +++ b/other/bankers_algorithm.py @@ -17,8 +17,6 @@ before deciding whether allocation should be allowed to continue. from __future__ import annotations -import time - import numpy as np test_claim_vector = [8, 5, 9, 7] @@ -216,7 +214,6 @@ class BankersAlgorithm: "Initial Available Resources: " + " ".join(str(x) for x in self.__available_resources()) ) - time.sleep(1) if __name__ == "__main__":