Commit fb57e952 rédigé par Rajat Jain's avatar Rajat Jain Commit de Anthony Marakis
Parcourir les fichiers

Reworked PriorityQueue and Added Tests (#1025)

* Reworked PriorityQueue spec

Modified:
- Priority Queue methods:
    queue[elem] now returns the first value of elem stored in queue
    elem in queue now correctly returns whether a copy of element is present regardless of the function value. Apparently the bug was introduced while trying to meet heapq spec
    del queue[elem] deletes the first instance of elem in queue correctly
- Algorithms
    Same change in best_first_graph_search in romania_problem.py and search.py to make them compatible with the new spec
- Tests
    Introduced 3 tests in test_utils.py to comprehensively test PriorityQueue's new spec

* Reworked PriorityQueue spec

Modified:
- Priority Queue methods:
    queue[elem] now returns the first value of elem stored in queue
    elem in queue now correctly returns whether a copy of element is present regardless of the function value. Apparently the bug was introduced while trying to meet heapq spec
    del queue[elem] deletes the first instance of elem in queue correctly
- Algorithms
    Same change in best_first_graph_search in romania_problem.py and search.py to make them compatible with the new spec
- Tests
    Introduced 3 tests in test_utils.py to comprehensively test PriorityQueue's new spec
parent 3b0faac4
Prend en charge le Markdown
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message !
Veuillez vous inscrire ou vous pour commenter