DISHOWN July challenge (Disjoint-set) doubt

Hii
I wrote two solutions one in c++ and one in JAVA Of DISHOWN
All variable names are same ,function names are same ,everything is same

Got AC in C++ :slight_smile: but in JAVA getting NZEC error :frowning: :(. PLz can anyone tell me Why is it so even though both programs are exactly same

C++ solution : CodeChef: Practical coding for everyone

JAVA solution : CodeChef: Practical coding for everyone

1 Like

@n1n1_4 : Are you using recursion in your logic . In Java stack space will exhaust soon and throw “StackOverFlow exception” .

3 Likes

@n1n1_4 : The following link may also be useful to you :

http://discuss.codechef.com/questions/47467/javadoes-recursive-function-posses-some-problem

1 Like

This answer
3
@n1n1_4 : Are you using recursion in your logic . In Java stack space will exhaust soon and throw “StackOverFlow exception” .

should be in the community wiki. Thanks Vineetpaliwal, you saved my day

@vineetpaliwal thanks i didn’t know this. I was using recursion in java. I appreciate you help. :):):slight_smile: