The bankers algorithm, sometimes also known as the detection algorithm. It is used for the avoidance of deadlock in an operating system. The bankers algorithm checks the safety of allocation of predetermined maximum possible resources and then makes states to check deadlock condition.