Fix RuntimeError in bipartite-check DFS/BFS and clean up doctests (#12814)
* Fix `RuntimeError` in bipartite-check DFS/BFS and clean up doctests * Iteration over `graph` mutated by `defaultdict` neighbours caused `RuntimeError: dictionary changed size during iteration`. – Iterate over `list(graph)` in both DFS and BFS helpers. * Corrected `if __name__ == "__main__":` typo. * Updated two doctests that now succeed after the fix. All doctests now pass (`30/30`), eliminating a critical runtime failure and improving reliability of the graph algorithms. Co-Authored-By: S. M. Mohiuddin Khan Shiam <[email protected]> * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py * Update check_bipatrite.py --------- Co-authored-by: Odio Marcelino <[email protected]> Co-authored-by: Maxim Smolskiy <[email protected]>
S
S. M. Mohiuddin Khan Shiam committed
561cc383ec04ba61eb9bab5ae891ef5328551df9
Parent: d927d67
Committed by GitHub <[email protected]>
on 8/24/2025, 9:47:46 PM