Click here to Skip to main content
15,922,574 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Question.Net 2.0 Applications and Windows 2008 Server Pin
sund7wells27-Jun-10 23:31
sund7wells27-Jun-10 23:31 
AnswerRe: .Net 2.0 Applications and Windows 2008 Server Pin
Not Active28-Jun-10 3:06
mentorNot Active28-Jun-10 3:06 
GeneralRe: .Net 2.0 Applications and Windows 2008 Server Pin
sund7wells28-Jun-10 18:18
sund7wells28-Jun-10 18:18 
GeneralRe: .Net 2.0 Applications and Windows 2008 Server Pin
Dave Kreskowiak28-Jun-10 18:28
mveDave Kreskowiak28-Jun-10 18:28 
QuestionRegistration form for a windows application installer Pin
arya12324-Jun-10 8:00
arya12324-Jun-10 8:00 
AnswerRe: Registration form for a windows application installer Pin
hammerstein0525-Jun-10 2:21
hammerstein0525-Jun-10 2:21 
QuestionStackOverflowException Pin
Mehdi Ghiasi24-Jun-10 6:36
Mehdi Ghiasi24-Jun-10 6:36 
AnswerRe: StackOverflowException Pin
Luc Pattyn24-Jun-10 7:28
sitebuilderLuc Pattyn24-Jun-10 7:28 
Mehdi Ghiasi wrote:
why .Net Framework 3.5 throw this invalid Exception


There probably isn't anything invalid here, your algorithm is such that a lot of recursion may occur.

Here is an example: assume an N*N map, all elements are -1 except for row 2, there they are all +1.
Now somehow you start at (2,N-1), the rightmost +1. Your Fill will call Fill(i, j - 1), which is +1 again, so it calls Fill(i, j - 1) which is +1 again, etc. You are basically pushing all elements of that row onto the stack, resulting in a nesting of N and that has used one dimension only.

There will be patterns that put big chunks of your N*N map on the stack, therefore it is either a bad algorithm or a bad implementation. A better algorithm would perform more work in the function itself, resulting in fewer stack pushes. You really need a stack push only when there are multiple ways to go and you can proceed on only one of them right away, then the others need pushed somehow. But then, a width first approach would be better than a depth first one.

Have a look at the "A* algorithm", or search for flood fill.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use < PRE > tags for code snippets, it preserves indentation, and improves readability.


AnswerRe: StackOverflowException Pin
supercat924-Jun-10 12:31
supercat924-Jun-10 12:31 
AnswerRe: StackOverflowException Pin
Luc Pattyn25-Jun-10 9:50
sitebuilderLuc Pattyn25-Jun-10 9:50 
QuestionCrystal Report Basic Text Interpretation problem Pin
dasha_pl23-Jun-10 4:51
dasha_pl23-Jun-10 4:51 
QuestionCreate ActiveX control with .net 4.0 Pin
awu2522-Jun-10 19:05
awu2522-Jun-10 19:05 
AnswerRe: Create ActiveX control with .net 4.0 Pin
Not Active23-Jun-10 2:34
mentorNot Active23-Jun-10 2:34 
GeneralRe: Create ActiveX control with .net 4.0 Pin
awu2523-Jun-10 4:41
awu2523-Jun-10 4:41 
GeneralRe: Create ActiveX control with .net 4.0 Pin
Not Active23-Jun-10 5:22
mentorNot Active23-Jun-10 5:22 
GeneralRe: Create ActiveX control with .net 4.0 Pin
awu2523-Jun-10 16:57
awu2523-Jun-10 16:57 
GeneralRe: Create ActiveX control with .net 4.0 Pin
Pete O'Hanlon23-Jun-10 21:56
mvePete O'Hanlon23-Jun-10 21:56 
GeneralRe: Create ActiveX control with .net 4.0 Pin
Pete O'Hanlon23-Jun-10 7:39
mvePete O'Hanlon23-Jun-10 7:39 
AnswerRe: Create ActiveX control with .net 4.0 Pin
Dave Kreskowiak23-Jun-10 3:13
mveDave Kreskowiak23-Jun-10 3:13 
QuestionXML Import Failing on XMLDocument.Load: Unexpected end of file has occurred. Pin
D.Dubya22-Jun-10 4:07
D.Dubya22-Jun-10 4:07 
QuestionDifferent query but get same result Pin
Naunt21-Jun-10 23:05
Naunt21-Jun-10 23:05 
AnswerRe: Different query but get same result Pin
Pete O'Hanlon21-Jun-10 23:28
mvePete O'Hanlon21-Jun-10 23:28 
GeneralRe: Different query but get same result Pin
Naunt22-Jun-10 1:17
Naunt22-Jun-10 1:17 
GeneralRe: Different query but get same result Pin
Pete O'Hanlon22-Jun-10 1:47
mvePete O'Hanlon22-Jun-10 1:47 
QuestionPage.ClientScript.RegisterClientScriptBlock Not Working in my page Pin
jintalPatel21-Jun-10 0:54
jintalPatel21-Jun-10 0:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.