운영체제-은행가 알고리즘 자바 구현

2490 단어 기술 공유
import java.util.Scanner; public class test { Scanner in=new Scanner(System.in); int[][] Max; // int[][] Allocation; // int[][] Need; // int[] Availables; // int[] Available; // int[] Allocations; int p; // int z; // int[] safe; // int[] Max1; int[] request; // int p2=0; // int request1=0; // int[] Need1; // need int ava=0; // available int available=0; public static void main(String[] args) { test tests=new test(); tests.definition(); } public void definition(){ /* */ System.out.println(" :"); p=in.nextInt(); // System.out.println(" :"); z=in.nextInt(); // Max=new int[p][z]; Allocation=new int[p][z]; Need=new int[p][z]; Availables=new int[p]; Available=new int[z]; safe=new int[p]; Need1=new int[p]; request=new int[z]; Max1=new int[p]; Allocations=new int[p]; for (int i=0;i

Need2[j]){ need=Need2[i]; Need2[i]=Need2[j]; Need2[j]=need; } } } for (int i=0;i

available){ return 0; } else{ for (int i=0;i

Need2[j]){ need=Need2[i]; Need2[i]=Need2[j]; Need2[j]=need; } } } if (Need2[0]>available){ return 0; } else{ for (int i=0;i


이 가능하다, ~할 수 있다,...

좋은 웹페이지 즐겨찾기