Re: PreOrder Tree Traversal




Mark Space wrote:
Jeff Higgins wrote:
Need help with my Tree.PreOrderIterator,
stack is stuck;


Do you have a debugger you can use? That seems to me to be the best idea
right now...

Debugger alone, no help.
Debugger with coffee, helpful;
Thanks :-)

public boolean hasNext() {
if (!stack.isEmpty()) {
EdgeContainer edge = nodeMap.get(stack.pop());
if (edge.left != null) {
if (edge.right != null) {
stack.push(edge.right.target); }
stack.push(edge.left.target);
return true; }
else if (edge.right != null) {
stack.push(edge.right.target);
return true; }
else if(edge.left == null && edge.right == null) {
if(stack.isEmpty())
return false;
stack.peek();
return true; }
else {
return false; }
} return false; }


.



Relevant Pages

  • Re: POP3 Locking up computer
    ... (other threads or GUI controls). ... if they stop responding, they are stuck somewhere. ... Your first step is to use the debugger and find out where your ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finding a point where a program is stuck in a loop
    ... source code so I'm doing it with the disassembly. ... is there a way to nail down where its getting stuck? ... This is a windows program, and I'm using ollydbg as the debugger. ...
    (comp.lang.asm.x86)
  • Re: POP3 Locking up computer
    ... while they are being downloaded nothing else works (other threads or GUI controls). ... I tried async reads, that didn't work. ... Applications don't just stop for no reason; if they stop responding, they are stuck somewhere. ... Your first step is to use the debugger and find out where your application is stuck. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: POP3 Locking up computer
    ... (other threads or GUI controls). ... I tried async reads, that didn't work. ... if they stop responding, they are stuck somewhere. ... Your first step is to use the debugger and find out where your ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ReadFile blocking even when it shouldnt
    ... threads have message handling routines (MsgWaitForMultipleObjects and WSAWaitForMultipleEvents). ... going through the code with the debugger one of the threads seem to get stuck at a call to ReadFile which should be ...
    (microsoft.public.vc.ide_general)