相关疑难解决方法(0)

在C#中使用递归

在使用递归来避免堆栈溢出时是否有任何一般规则?

c# stack-overflow recursion

16
推荐指数
3
解决办法
2万
查看次数

如何更改控制台应用程序的堆栈大小?

可能重复:
如何更改.NET程序的堆栈大小?

我想更改以下控制台应用程序的堆栈大小:

using System;
using System.IO;

class Test {

    static int n;
    static bool[] us;
    static int[,] matr;

    static void dfs(int a) {
        us[a] = true;
        for (int b = 0; b < n; b++) {
            if (!us[b]) {
                dfs(b);
            }
        }
    }

    static void Main() {
        StreamReader input = new StreamReader("input.txt");
        StreamWriter output = new StreamWriter("output.txt");
        string[] snum = input.ReadLine().Split(' ');
        n = int.Parse(snum[0]);      // number of vertices
        int m = int.Parse(snum[1]);  // number of edges
        us = …
Run Code Online (Sandbox Code Playgroud)

c# stack-overflow stack-size

2
推荐指数
1
解决办法
3466
查看次数

标签 统计

c# ×2

stack-overflow ×2

recursion ×1

stack-size ×1