<identifier> expected public void minimumcost(table)

32. satırda bu hatayıveriyor


bir de &&#35039;)&&#35039;expected yazıyor.

Java konusunda bilgisi olan bir arkadaş ilgilenebilrise sevinirim.


import javax.swing.*;
import java.util.Random;
import java.util.Arrays;
import java.lang.String;

public class Project
&&#35123;
	int [][]table=&&#35123;//We have 10x10 array
		&&#35123;0,550,0,0,50,0,0,0,0,0,50},//ROW1
		&&#35123;0,0,150,200,0,200,0,0,0,0},//ROW2
		&&#35123;0,0,0,0,0,150,0,0,0,0},//ROW3
		&&#35123;0,0,0,0,0,200,0,0,0,0},//ROW4
		&&#35123;0,0,0,0,0,0,100,0,0,0},//ROW5
		&&#35123;0,0,0,0,0,0,0,500,0,0},//ROW6
		&&#35123;0,0,0,0,0,100,0,100,0,0},//ROW7
		&&#35123;0,0,0,0,0,0,0,0,600,0},//ROW8
		&&#35123;0,0,0,0,0,0,0,0,0,0},//ROW9
		&&#35123;0,0,0,0,0,0,50,0,0,0}//ROW10	
		};
	public void main(String[]args)
	&&#35123;
		System.out.println("We have the minimum cost in this sequence:");
		MinimumCost(table);
	}
	
	public void MinimumCost(int[][]table)
	&&#35123;
		int factorialNine=factorial(9);//When we put the first element on the array ,there is left 9! possibilities
		//to put the other numbers.Below ,we say row i 9!
		int[][]oneLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 1
		int[][]twoLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 2
		int[][]threeLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 3
		int[][]fourLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 4
		int[][]fiveLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 5
		int[][]sixLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 6
		int[][]sevenLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 7
		int[][]eightLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 8
		int[][]nineLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 9
		int[][]tenLeadArrays=new int[factorialNine][10];//Whole possibilities of the array that starts with 10
		
		//LoadLeadArray fills the array with all possibilities that starts with index number in the function;i.e here it is 0
		oneLeadArrays=LoadLeadArray(1);
		twoLeadArrays=LoadLeadArray(2);
		threeLeadArrays=LoadLeadArray(3);
		fourLeadArrays=LoadLeadArray(4);
		fiveLeadArrays=LoadLeadArray(5);
		sixLeadArrays=LoadLeadArray(6);
		sevenLeadArrays=LoadLeadArray(7);
		eightLeadArrays=LoadLeadArray(8);
		nineLeadArrays=LoadLeadArray(9);
		tenLeadArrays=LoadLeadArray(10);
		
		int holdSmallestOneLead=SmallestCost(oneLeadArrays,table);
		int holdSmallestTwoLead=SmallestCost(twoLeadArrays,table);
		int holdSmallesthreeOneLead=SmallestCost(threeLeadArrays,table);
		int holdSmallestFourLead=SmallestCost(fourLeadArrays,table);
		int holdSmallestFiveLead=SmallestCost(fiveLeadArrays,table);
		int holdSmallestSixLead=SmallestCost(sixLeadArrays,table);
		int holdSmallestSevenLead=SmallestCost(sevenLeadArrays,table);
		int holdSmallestEightLead=SmallestCost(eightLeadArrays,table);
		int holdSmallestNineLead=SmallestCost(nineLeadArrays,table);
		int holdSmallestTenLead=SmallestCost(tenLeadArrays,table);
		
	}
	
	public int factorial(int number)
	&&#35123;
		if(number==1)
			return 1;
		else
		&&#35123;
			return number*(number-1);
		}
	}
	
	public int [][]  LoadLeadArray(int index)//
	&&#35123;
		Random random=new Random();
		int[][]hold=new int[factorial(9)][];
		
		int i=0;
		for(;i<factorial(9);i++)//We start to put elements in the array from index 1
		&&#35123;
			if(i==0)//If we are at 0,there is no need to check the other rows if they&&#35039;re equal or not.Otherwise,we have to check
			&&#35123;
				hold[i][0]=index;
			
				for(int j=1;j<=9;j++)
				&&#35123;
					int holdRandom=1+(int)(Math.random()*10);//It creates random number between 1 and 10; one and nine included
					while(holdRandom==index)
					&&#35123;
						holdRandom=1+(int)(Math.random()*10);				
					}
					if(ArrayCheck(hold_hold,holdRandom,j,hold[i][j]))
					&&#35123;
						hold[i][j]=holdRandom;
					}
				
			
				}//At the end of this for loop;each row will be loaded by different number and they&&#35039;re not same
			
			}
			else
			&&#35123;
				hold[i][0]=index;
				
				int []hold_hold=new int[9];
			
				for(int j=1;j<=9;j++)
				&&#35123;
					int holdRandom=1+(int)(Math.random()*10);//It creates random number between 1 and 10; one and nine included
					while(holdRandom==index)
					&&#35123;
						holdRandom=1+(int)(Math.random()*10);				
					}
					if(ArrayCheck(hold_hold,holdRandom,j))
					&&#35123;
						hold_hold[j]=holdRandom;
					}
				
			
				}//At the end of this for loop;each row will be loaded by different number and they&&#35039;re not same
			
				if(CheckTheOtherRows(hold,hold_hold,i-1))
				&&#35123;
					for(int k=0;k<=9;k++)
						hold[i][k]==hold_hold[k];
				}
		
			}
		
		}
		
		return hold[i];
		
	}
	
	public void CheckTheOtherRows(int[}[]hold,int []hold_hold,int bigRow)
	&&#35123;
		for(int i=0;i<=bigRow;i++)
		&&#35123;
			if(ArrayToString(hold[i])== ArrayToString(hold_hold))
				return false;
		}
		
		return true;
	}
	
	public String ArrayToString(int[]array)
	&&#35123;
		String str="";
		
		for (int i = 0; i < array.length; i++)
      		str = str + stringarray[i];
    	
    	return str;
	}
	
	public boolean ArrayCheck(int []number,int random,int j)//DUZELTİLECEK
	&&#35123;
		int newRandom;
		
		if(NotInTheArray(number,random,j))
		&&#35123;
			return true;
		}

		else
		&&#35123;
			while( !NotInTheArray(number,random,j))//Send only the row
			&&#35123;
				newRandom=1+(int)(Math.random()*10);
				ArrayCheck(number,newRandom,j);//There is a recursion
			}
			continue;
		}
	
	}

	
	public boolean NotInTheArray(int []hold,int check,int checkedIndex)
	&&#35123;
		if(checkedIndex==1)
			return true;
		else
		&&#35123;
			for(int i=1;i<checkedIndex;i++)
			&&#35123;
				if(hold[i]== check)
					return false;
			}
		}
		return true;
	}
	
	public int SmallestCost(int[][]array,int[][]table)
	&&#35123;
		int sum =0;
		
		for(int row=0;row<factorial(9);row++)
		&&#35123;
			for(int column=0;column<=9;column++)
			&&#35123;
				
			}
		}
	}
		
}


Bu konu atacker tarafından düzenlendi(2008-05-14 20:25, 17 yıl önce)

Üye Ol veya Giriş Yap

Bu forum başlığına mesaj atmak istiyorsanız hemen üye olun veya giriş yapın.