Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package signalFlowGraph;
- import java.util.Scanner;
- public class AnalyzeSFG {
- private int[][] adjMatrix;
- public static void main(String[] args) {
- AnalyzeSFG g = new AnalyzeSFG();
- g.inputs();
- }
- private void inputs() {
- Scanner scan = new Scanner(System.in);
- System.out.print("Enter The Number Of Nodes : ");
- int NumOfNodes = scan.nextInt();
- adjMatrix = new int[NumOfNodes][NumOfNodes];
- System.out.println("To Get Out From Entering Signal Flow Graph Representation");
- System.out.println("Put From = 0 ");
- while (true) {
- int from, to, gain;
- System.out.print("From : ");
- from = scan.nextInt() - 1;
- if (from < 0) {
- break;
- }
- System.out.print("To : ");
- to = scan.nextInt() - 1;
- System.out.print("gain : ");
- gain = scan.nextInt();
- adjMatrix[to][from] = gain;
- }
- }
- private void queen(int nextNodeInThePath) {
- if (nextNodeInThePath == 8)
- counter++;
- for (int columnIndex = 0; columnIndex < 8; columnIndex++)
- if (canPut(nextNodeInThePath, columnIndex)) {
- addToForwardPath(nextNodeInThePath, columnIndex);
- queen(nextNodeInThePath + 1);
- removeFromForwardPath(nextNodeInThePath, columnIndex);
- // لو اللي بعدي ملقاش مكان يتحط فيه، شيلني وغير مكاني وكمل
- // او لو لقيت طريقة ناجحة وعايز ارجع عشان اشوف بقيت الطرق
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement