当前位置: 代码迷 >> Eclipse >> 堆栈溢出,该怎么解决
  详细解决方案

堆栈溢出,该怎么解决

热度:25   发布时间:2016-04-23 13:34:05.0
堆栈溢出,该如何解决?
public static void Relevance(String[][] MineSweepingList,
String[][] MineSweepingList2, int row, int list, long size,
String[] recurrenceOfCondition, int numberOfROC) {
MineSweepingList2[row][list] = "口";
if (list + 1 < size % 100) {
if (MineSweepingList[row][list + 1] == " 0 "
&& MineSweepingList2[row][list + 1] != "口") {
MineSweepingList2[row][list + 1] = "口";
Relevance2(MineSweepingList, MineSweepingList2, row, list + 1,
size, recurrenceOfCondition, numberOfROC);
} else
MineSweepingList2[row][list + 1] = MineSweepingList[row][list + 1];
}
if (row + 1 < size / 100) {
if (MineSweepingList[row + 1][list] == " 0 "
&& MineSweepingList2[row + 1][list] != "口") {
MineSweepingList2[row + 1][list] = "口";
Relevance2(MineSweepingList, MineSweepingList2, row + 1, list,
size, recurrenceOfCondition, numberOfROC);
} else
MineSweepingList2[row + 1][list] = MineSweepingList[row + 1][list];
}
if (list - 1 >= 0) {
if (MineSweepingList[row][list - 1] == " 0 "
&& MineSweepingList2[row][list - 1] != "口") {
MineSweepingList2[row][list - 1] = "口";
Relevance2(MineSweepingList, MineSweepingList2, row, list - 1,
size, recurrenceOfCondition, numberOfROC);
} else
MineSweepingList2[row][list - 1] = MineSweepingList[row][list - 1];
}
if (row - 1 >= 0) {
if (MineSweepingList[row - 1][list] == " 0 "&&MineSweepingList2[row - 1][list] != "口"){
MineSweepingList2[row - 1][list] = "口";
Relevance2(MineSweepingList, MineSweepingList2, row-1, list - 1,
size, recurrenceOfCondition, numberOfROC);
}
else
MineSweepingList2[row - 1][list] = MineSweepingList[row - 1][list];
}
}

public static void Relevance2(String[][] MineSweepingList,
String[][] MineSweepingList2, int row, int list, long size,
String[] recurrenceOfCondition, int numberOfROC) {
MineSweepingList2[row][list] = "口";
if (row + 1 < size / 100 && list + 1 < size % 100) {
if (MineSweepingList[row + 1][list + 1] == " 0 "
&& MineSweepingList2[row + 1][list + 1] != "口") {
MineSweepingList2[row + 1][list + 1] = "口";
Relevance(MineSweepingList, MineSweepingList2, row + 1,
list + 1, size, recurrenceOfCondition, numberOfROC);
} else
MineSweepingList2[row + 1][list + 1] = MineSweepingList[row + 1][list + 1];
}
if (row + 1 < size / 100 && list - 1 >= 0) {
if (MineSweepingList[row + 1][list - 1] == " 0 "
&& MineSweepingList2[row + 1][list - 1] != "口") {
MineSweepingList2[row + 1][list - 1] = "口";
Relevance(MineSweepingList, MineSweepingList2, row + 1,
list - 1, size, recurrenceOfCondition, numberOfROC);
} else
MineSweepingList2[row + 1][list - 1] = MineSweepingList[row + 1][list - 1];
}
if (row - 1 >= 0 && list - 1 >= 0) {
if (MineSweepingList[row - 1][list - 1] == " 0 "
&& MineSweepingList2[row - 1][row - 1] != "口") {
MineSweepingList2[row - 1][row - 1] = "口";
Relevance(MineSweepingList, MineSweepingList2, row - 1,
list - 1, size, recurrenceOfCondition, numberOfROC);
} else
MineSweepingList2[row - 1][row - 1] = MineSweepingList[row - 1][list - 1];
}
if (row - 1 >= 0 && list + 1 < size % 100) {
if (MineSweepingList[row - 1][list + 1] == " 0 "
&& MineSweepingList2[row - 1][list + 1] != "口") {
MineSweepingList2[row - 1][list + 1] = "口";
  相关解决方案