Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
WHY IS THIS HAPPENING?!?!?!?!
I have 2 implementations of a recursive function, one using sets, the other using bitsets. Both functions are EXACTLY the same apart from the fact that one uses a set container, the other a bitset (obviously the set one will use functions such as .insert as opposed to .set but apart from that, the algorithms are exaclty the same).
Now, the function is to solve sudoku problems and it works fine, for all levels of a problem (i.e. for a puzzle with as many missing digits as is possible).
However, the bitset version stops working after 3973 recursions and set implementation stops working after 2017 recursions (that is, it either stops working after that amount of recursions or solves the puzzle, which ever one happens first).
I posted a message on the message board a few days ago and 2 people told me that this was happening because of a stack overflow. I don't think this is true however as a sudoku problem is very small and my computer is very big!
Each time the program crashes in VC++6 I get the following error message:
"Unhandelled exception in "new set investigation.exe" (KERNEL32.DLL): 0xC0000005
NOTE: The above message is for the set implementation, the bitset's one is a little different.
If I click OK in the dialog box that displays this message, VC++6 takes me to some disassembly stuff at line:
7C8024E5 push ebx
I have no idea what this all means but I reall really want to!!!!
I also checked the Windows Task Manager at the recursion just before the program crashes and the amount of memory it was using up was a tiny 5,528K and 00 of the CPU.
Does anyone know why my program is stopping after a certain amount of recursions? It cant be a stack overflow.....
PS, I've also tried running the program on different machines and outside the VC++6 environment but the smae thing happens with the same number of recursions.
0 · ·