xmlserializer
xmlserializer copied to clipboard
Implement in a non-recursive way to avoid stack overflows
Some documents will cause the parser to throw a stack overflow exception (Maximum call stack exceeded). This can be avoided by making the code-non recursive.
Happy to see an idea and/or code for that.
Non-recursive graph traversal is often done by making use of an auxiliary data structure, a stack or queue. The advantage of using a heap-allocated data structure rather than the call stack is that the heap usually has a higher limit.
Examples of non-recursive graph traversal include non-recursive DFS or BFS.