It's back! Take the 2018 Developer Survey today »
0
votes
0answers
16 views

Recursive Sort Function EXC_BAD_ACCESS

I am trying to sort odd positioned pixels of a picture in a recursive function. This piece of code works for really small images that require only few calls, but gives me a EXC_BAD_ACCESS when applied ...
0
votes
1answer
24 views

Max Stack exceeded error, how would I fix this?

I am making a function that returns true if number in outerfucntion is within innerfunction list <script> function hasMatch(item) { hasMatch(2) function inList() { var List = [...
0
votes
2answers
74 views

Stack overflow while using recursive function

I am trying to do a simple coding challenge that requires me to do the following: You are given n, return an array ans, composed in such way: `ans = [n, n - 5, n - 10, ... , m, m + 5, ... , n - 5, n]...
1
vote
1answer
69 views

Tail recursion: comparing two cases

Why is this tail recursion: def navigate(myList : List[Int]) : (Int, List[Int]) = { def navigate(step: Int, offset: Int, myList: List[Int]): (Int, scala.List[Int]) = { if //some test and ...
0
votes
2answers
20 views

C# - Changing Value of Datagridview Multiple Cells Causing Recurive Loop

I want to Update the value of datagridview cell(s) of a row if any one cell value of same row is change. Here is my Code... private void DGV_CellValueChanged(object sender, ...
1
vote
2answers
47 views

Available stack size is not used by R, returning “Error: node stack overflow”

I have written a recursive code in R. Before invoking R, I set the stack size to 96 MB at the shell with: ulimit -s 96000 I invoked R with maximum protection pointer stack size of 500000 with: R --...
0
votes
0answers
71 views

Stack Overflow Error, m-ary tree size

What's wrong with my recursion logic? I'm trying to find the size of an m-ary tree. An MTree Node's children is represented by an ArrayList I implemented. My logic was to have a for loop as big as m ...
0
votes
0answers
25 views

Segmentation fault due to stackoverflow in depth first search?

Im trying to solve this competitve coding problem, i've tried to use two depth first searches but im getting a segmentation fault. This might be due to stack overflow because there can be upto 10000 ...
0
votes
1answer
46 views

Spring Data Elastic and recursive document mapping

I have a Spring application where I use Spring Data Elastic for accessing Elasticsearch data. The data model requires recursion and it causes headache for Spring Data Elastic, because I got java.lang....
0
votes
1answer
39 views

Is it possible to track the stack height / recursion depth reliably?

I'm trying to reliably keep track of my stack height in a certain portion of my program, in order to adaptively tune a machine learning algorithm. Right now, my code looks like this: private const ...
-1
votes
2answers
40 views

Quick Sort Overflow

My assignment is to benchmark the different run-times of various sorting algorithms. I was able to get all of my algorithms running. However, I run into an overflow problem when dealing with large ...
0
votes
2answers
31 views

How can I fix my java quick sort?

The problem is, it's a neverending recursion. I don't know, how can I finish the recursion. The funny is, it works, if I print the arraylist (mergedArray), it will be sorted after some iteration, but ...
0
votes
0answers
11 views

Unity - Stack Overflow Error when using recursion to place keys

I am getting a stack overflow error when I run my script to go through door connections and place locked doors in a procedural dungeon, along with their corresponding keys so they can always be ...
0
votes
0answers
16 views

StackOverFlowError when using recursion on SplayTree [duplicate]

I implemented a Splay Tree class that uses nodes to store data. When data is passed into the tree and the splay method is called, I get a StackOverFlowError. I tried some tests and found out that any ...
1
vote
2answers
32 views

StackOverFlow Error when converting 1,000,000 Nodes in a Splay Tree to a SinglyLinkedList

I have implemented a Splay Tree class that uses nodes to store data. In this class I have tried to convert the data of nodes into a Singly Linked List. 1,000,000 nodes can be inserted into the splay ...
0
votes
1answer
37 views

Scala recursion, overflow

Here are 2 functions: def Foo1(s: ((BigInt, Long) => Long) => ((BigInt, Long) => Long)): (BigInt, Long) => Long = s(Foo1(s)) def Foo2(s: (=> (BigInt, Long) => Long) => ((BigInt, ...
3
votes
1answer
115 views

Stack overflow during evaluation in OCaml

I encountered a stack overflow issue when implementing a square root approximation algorithm by Heron of Alexandria, given as follows: We start with an initial (poor) approximate answer that the ...
2
votes
1answer
50 views

Stack Overflow during Recursion

I am trying to write a program that when given a function and a high and low value, it finds the zero between the high and low. I have written it recursively in a binary search style. When I run a ...
1
vote
5answers
77 views

What's wrong in this design that causes infinite loop?

I will explain myself by giving you a descriptive example. Let's say I'm programming a very simple Cloud Storage Simulation, a simple terminal program. I have two main classes, User and File coded as ...
1
vote
4answers
104 views

Stack Over Flow When computing n = ~11000 + fibonacci recursive method with memoization

I have a program to compute the nth Fibonacci number with a recursive method and while using memoization. I get up to around n = 11000 and I am getting a stackoverflow exception. Can someone help me ...
0
votes
1answer
48 views

Why this recursive function is throwing StackOverFlow error???this is my logic for binary search and Where is the exact point of error in it

This is my logic for binary search and when I try to run it it gives me error of stackoverflow....I have written base condition also. Where is the exact point of error in it. For this code, I have ...
0
votes
3answers
70 views

StackOverFlow Exception in recursion calls

Im trying out a bitwise And program for the range of number between a and b . Can have 'n' testcases for that. 0<=a,b<=2^32 1<=n<=200 EXPLANATION : 1 2 4 computation : 2&3&...
1
vote
1answer
177 views

Game loop of a turn-based game

Currently, I'm working on an AI for a simple turn-based game. The way I have the game set up is as following (in pseudo-code): players = [User, AI]; (for player : players){ player....
0
votes
2answers
71 views

C++ Run-time Preempting Stack-Overflows

I'm trying to write a library which can parse end user files to be used for adding some simple user generated content into a project and I want to try and make the library as flexible as possible. I ...
-3
votes
2answers
54 views

java getting stack overflow-program is not recursive

I have been working on my "Random Trivia" program and I keep getting stack overflow with NO recursiveness, at least I cannot find any, here is the code to Gui.java, the main class(and only class) ...
-1
votes
1answer
47 views

Recursive StackOverflow Exception

I was trying to do a sudoku solver program and I have a problem with StackOverflow Exception. I don't know what I have to do to resolve that problem because the algorithm is good and is working if ...
-1
votes
1answer
73 views

Increase the recursive ability of Eclipse [closed]

I'm writing a java program in Eclipse, and when I try to use recursion it gives this error: Exception in thread "main" java.lang.StackOverflowError I know that people have probably already asked ...
0
votes
1answer
35 views

StackOverflowException in QuickSort

I need to use a quick sort to order some very large lists (thousands of items). However when I attempt this I get the exception System.StackOverflowException. From some quick googling I know this is ...
-2
votes
1answer
46 views

I dont know how i should amend my base case to avoid stack over flow in my recursive code

Ok so basically my code needs to calculate the sum of the path in an nxn matrix ( starts at 0,0), and adds up the smallest sum where I'm only allowed to move right or downwards. For example the ...
0
votes
1answer
44 views

Java - StackOverflowError for prime recursion

Why does this code give me a stackoverflowerror? I'm trying to make the count primes function faster than O(n**2). My Code: public class TestingJavaCode { public int countPrimes(int n) { ...
0
votes
3answers
66 views

StackOverflow Error

I am writing this program to check if the word which is entered by the user, is a Palindrome(the word reads the same when spelled backwards) or not. I am using recursion, as the task i was given ...
0
votes
1answer
115 views

java.lang.StackOverflowError due to iterator in DFS

I am currently trying to make a graph represantation of a game by creating the graph class by myself. The constructor is this one (hope I dont have any logic mistake here): private int nNodes; ...
0
votes
1answer
78 views

How to deal with StackOverflow errors when recursing?

I'm currently working on a program that reads in a "map" of size n * n. This "map" is made of characters . and *, where . represents water, and * represents land. The point of the program is to ...
0
votes
1answer
55 views

Recursion ocaml stack overflow

I'm trying to draw fractal: for every circle displeyed I want to draw circle half it's size to the left and right of that circle. Here is my code: let rec drawCircle x y r = let halfSize = r/2 ...
3
votes
0answers
71 views

stack overflow exception in recursion java

My problem is when i change the first parameter into over 300 in line 133, i get a java.lang.StackOverflowError in line 37.This line is a recursion. How can i solve this? public class ...
-2
votes
2answers
77 views

How to clear stack after recursion ended?

Because I was having problems with stack overflowing due too deep recursion, I've tried playing around it using while loop. but even tho exiting the recursion before the overflow and re-entering the ...
1
vote
1answer
57 views

stackoverflowerror when processing depth-first-iteration via scala

I intend to recursively iterate all grids within a circle zone, the code below will perform depth-first-search. But after 204 stacks, java.lang.StackOverflowError will be thrown. def ...
5
votes
1answer
91 views

javascript recursive stack overflow

Is there anybody would explain why the result is different below? // test one function computeMaxCallStackSize() { try { return computeMaxCallStackSize() + 1; } catch (e) { ...
2
votes
1answer
77 views

Infinite recursive function -> Stack Overflow error

I have an infinite recursive loop in java public void infiniteLoop(Long x){ System.out.println(""+x); infiniteLoop(x + 1); } public static void main(String[] args) { StackOverFlow st =...
4
votes
2answers
209 views

Do stack overflow errors occur in Haskell?

As a pure functional programming language, Haskell intensively uses recursion. Do stack overflow errors occur in Haskell, like in Java? Why, or why not?
1
vote
2answers
66 views

Can I recursively source a TCL script indefinitely?

I have a TCL script running inside a TCL shell (synopsys primetime if it's of any difference). The script is initiated by source <script> from the shell. The script calls itself recursively ...
-1
votes
3answers
201 views

Stack overflow in recursive method

I'm writing a program that allows a user to input a set of integers into an array and characteristics of those numbers will be displayed once a zero is entered. I am having an issue with one method:...
0
votes
1answer
53 views

Avoiding StackOverflowError with adding and subtracting 32 digit numbers

I seem to be unable to stumbling into some recursion problems with my latest code. I am adding and subtracting custom numbers of 32 digits. The numbers are stored in an array. Here's the bit of code ...
0
votes
2answers
33 views

Quicksort Recursion - StackOverFlow

I'm implementing a recursive quicksort however I'm receiving stackoverflow and not sure where the bug lies :( I'm sorting 1 million ints from 10-50. I works for sizes less than 1 million like 100 ...
-1
votes
1answer
35 views

Getting a stack overflow from this recursive method?

Here is the method, it ideally should solve the eight-queens problem by placing Qs on the board so that none of them threaten each other, but I can't seem to stop it from infinitely recursing. public ...
0
votes
0answers
50 views

Stack Overflow in Sudoku Generator

I encountered the legendary StackOverflow error at lines 25 (random number) and line 29 (where fillGrid() recursively calls itself). I wish to know why this would happen as I have already provided the ...
10
votes
2answers
1k views

ES6 Tail Recursion Optimisation Stack Overflow

Having read Dr Rauschmayer's description of recursive tail call optimisation in es6, I've since been trying to recreate the 'zero-stack' execution of the recursive factorial function he details. Using ...
0
votes
2answers
67 views

Recursive algorithms and StackOverFlow Error

I have been coding a recursive algorithm in order to go through different nodes and analyze all the paths in a directed acyclic graph. The thing is that, after some new data has been introduced to the ...
2
votes
2answers
179 views

A range function in Javascript written recursively

For my own learning and practice I tried to implement a function in Javascript which would populate an array with integers from 1 to the argument 'limit'. One way I did it was with a for loop: ...
0
votes
1answer
67 views

Scala: Recursion with future Stack overflow error

Consider below code snippet. Too many take() calls will result in stack overflow error. What is the good strategy to overcome such scenarios? def take(): Future[Int] = { val processResponseF: ...