Skip to content

Instantly share code, notes, and snippets.

# P0, P1, P2, P3, P4 are the Process names here
n = 5 # int(input('Enter number of process: ')) # Number of processes
m = 3 # int(input('Enter number of resources: ')) # Number of resources
# Allocation Matrix
alloc = [[0, 1, 0], [2, 0, 0], [3, 0, 2], [2, 1, 1], [0, 0, 2]] #
# for i in range(n):
# alloc.append(list(map(int, input(f'Enter {i + 1} allocation: ').split(' '))))
# MAX Matrix
max = [[7, 5, 3], [3, 2, 2], [9, 0, 2], [2, 2, 2], [4, 3, 3]] #