The banker’s algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.
Banker's Algorithm in Operating Systems : https://www.geeksforgeeks.org/bankers-algorithm-in-operating-system-2/