Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3944246
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:52:39+00:00 2026-05-20T00:52:39+00:00

I have an algorithm that uses deep recursion. How many levels deep the recursion

  • 0

I have an algorithm that uses deep recursion. How many levels deep the recursion will go varies and depends on the input. To avoid stack overflow exceptions I keep count of the depth and terminate at a specific depth.

By a bit of experimentation I previously established that a level of 500 was the point at which to stop. However, now suddenly I get stack overflow exceptions at levels just over 300.

Can anyone shed a bit of light on which factors would affect this? Is it e.g. CPU and RAM? Or related to which other processes is running on the computer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:52:40+00:00Added an answer on May 20, 2026 at 12:52 am

    The answer varies, see here: Stack capacity in C#

    You would be wise to change your algorithm to not be recursive, it will not be easy to see how much you can recurse, and basically you are tempting fate if you attempt to predict a certian level of recursion depth. That and whatever estimation algorithm you use for the stack depth might break with the next .NET service pack.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an algorithm that generates strings based on a list of input words.
I have a fairly large, sophisticated algorithm that uses a std::priority_queue . In some
I have a two part question Best-Practice I have an algorithm that performs some
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily
Does anybody have any reference material that details Cauchy-Reed algorithm? Googling for Cauchy-Reed Solomon
I am working on an external sorting algorithm that uses std::queue and must carefully
We have several different optimization algorithms that produce a different result for each run.
I have a recursive algorithm which steps through a string, character by character, and
Does anyone have a decent algorithm for calculating axis minima and maxima? When creating
Does anyone have a good algorithm for taking an ordered list of integers, i.e.:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.