| | |
recusive method problem
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2007
Posts: 7
Reputation:
Solved Threads: 0
after finishing while loop,when it wants to quit the recursive( node curr) method,it comes back again to the recursive call(recursive (nod)) in the for loop and it traps in several loops till an exception occurs saying that "index was out of the rang of the array" .
can anyone help please...
can anyone help please...
publicvoid recursive(Node curr) { while ( sour <= source.Length - 2) { for (int i = 0; i < curr.ChildNumber; i++) { nod = (Node)curr.nextNode[i]; while (source[sour] != nod.CurrentNodeName) { continue; } sour = sour + 1; Console.WriteLine(nod.CurrentNodeName); recursive((Node)nod); } sour = sour + 1; } }
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
You have all your logic in a big tangled mess.
I suggest you start by writing in pseudo code what you want to do and then code. You have while loops that do nothing, while loops inside for loops inside while loops and call the same method inside all those loops. A recipe for disaster.
You can simplify this greatly.
I suggest you start by writing in pseudo code what you want to do and then code. You have while loops that do nothing, while loops inside for loops inside while loops and call the same method inside all those loops. A recipe for disaster.
You can simplify this greatly.
![]() |
Similar Threads
- How to call Client.java from HTML? (Java)
- Problem while installing linux (*nix Software)
- gets() problem in C (C)
- Help with replace method. (Java)
- Windows XP Proffesional - Explorer problem (Windows NT / 2000 / XP)
- XP won't restart, keeps rebooting (Windows NT / 2000 / XP)
- Guestbook help. Post in two different spots. (Perl)
Other Threads in the C# Forum
- Previous Thread: workink with list box in GUI
- Next Thread: Help Needed in C# (picture viewer)
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format formatting forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot marshalbyrefobject math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





