Banker's Algorithm Calculator
Works the deadlock-avoidance question two ways: whether the current allocation state is safe, and whether a particular request can be granted without making it unsafe. Both are shown step by step, with the need matrix and the work vector at every stage, because that is what the marks are for.
Safe does not mean deadlock-free by luck
A state is safe when there exists some order in which every process can finish, assuming each one may eventually claim up to its declared maximum. That is a pessimistic assumption on purpose: the banker refuses anything that could corner the system even in the worst case, which is why a request can be refused while resources are sitting free.
An unsafe state is not the same as a deadlocked one. Unsafe means deadlock has become possible if every process claims its maximum; the system may still escape if processes happen to release resources first. Avoidance means never finding out.
Reading the safe sequence
The safety algorithm looks for any process whose remaining need fits the current work vector, runs it to completion on paper, and adds everything it held back into work. Repeat until every process is accounted for, or until nothing fits — which is what "unsafe" means.
A safe state usually has more than one safe sequence. Textbooks print whichever their trace found first, so an answer different from the book is not automatically wrong: check that at each step the chosen process's need really does fit the work vector at that moment. This tool picks the lowest-numbered process that fits, which is the common hand-working convention.
Requests: three possible answers
The resource-request algorithm asks three questions in order, and they mean different things.
If the request exceeds the process's declared need, that is a programming error, not a wait — the process has broken the maximum claim it registered up front.
If the request exceeds what is available, the process waits. There is nothing wrong; the resources simply are not there yet.
Otherwise the request is granted tentatively, the safety algorithm runs on the resulting state, and if that state is unsafe the whole grant is rolled back and the process waits. This is the case students most often get wrong, because both earlier checks passed and it still gets refused.
What it does not model
A single instance per resource type is better handled by a resource-allocation graph with cycle detection. The banker's algorithm also assumes the maximum claim of every process is known in advance, which is why real kernels do not use it — Linux and Windows both allow deadlock and deal with the consequences instead.
Where this fits
The banker's algorithm avoids deadlock by refusing requests that could lead to an unsafe state. It is usually taught alongside process scheduling, covered by the CPU scheduling calculator, and memory management, covered by the memory allocation and page replacement calculators.