I was doing question http://www.codechef.com/problems/FIRESC/
Which is the simplest question in graph and based on dfs.
I coded it in java and I also know that In java stack space is very less.So I am getting NZEC error.
As i started practicing graph.And A lot of graph question i will do in java So again i will get NZEC.
So its my serious problem. Plz Tell me
- Should i switch to c++(which i don’t want )?
- Should i convert recursion procedure into iterative in java(lots of graph question are very touch through iterative procedure)?
- Any other alternative suggestion plz…
I still want recursive method and want to submit it in java.
My solution to the above problem in which i got NZEC error b/c of using recursion in java : http://www.codechef.com/viewsolution/4373427