Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
  • No Android code style. In fact, it's much easier to deal with left, right, and key in the Eclipse debugger instead of mLeft, mRight, and mKey.
  • The node names p and q are left, and I explained why.
  • The node name is parent rather than root in the method insert(Node parent, int key).
  • Duplicates are not allowed. I'd handle duplicates this waythis way if I needed to. Let me insert the quote I mean:
  • No Android code style. In fact, it's much easier to deal with left, right, and key in the Eclipse debugger instead of mLeft, mRight, and mKey.
  • The node names p and q are left, and I explained why.
  • The node name is parent rather than root in the method insert(Node parent, int key).
  • Duplicates are not allowed. I'd handle duplicates this way if I needed to. Let me insert the quote I mean:
  • No Android code style. In fact, it's much easier to deal with left, right, and key in the Eclipse debugger instead of mLeft, mRight, and mKey.
  • The node names p and q are left, and I explained why.
  • The node name is parent rather than root in the method insert(Node parent, int key).
  • Duplicates are not allowed. I'd handle duplicates this way if I needed to. Let me insert the quote I mean:
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

Revision 1.Revision 1.

  • No Android code style. In fact, it's much easier to deal with left, right, and key in the Eclipse debugger instead of mLeft, mRight, and mKey.
  • The node names p and q are left, and I explained why.I explained why.
  • The node name is parent rather than root in the method insert(Node parent, int key).
  • Duplicates are not allowed. I'd handle duplicates this way if I needed to. Let me insert the quote I mean:

Revision 1.

  • No Android code style. In fact, it's much easier to deal with left, right, and key in the Eclipse debugger instead of mLeft, mRight, and mKey.
  • The node names p and q are left, and I explained why.
  • The node name is parent rather than root in the method insert(Node parent, int key).
  • Duplicates are not allowed. I'd handle duplicates this way if I needed to. Let me insert the quote I mean:

Revision 1.

  • No Android code style. In fact, it's much easier to deal with left, right, and key in the Eclipse debugger instead of mLeft, mRight, and mKey.
  • The node names p and q are left, and I explained why.
  • The node name is parent rather than root in the method insert(Node parent, int key).
  • Duplicates are not allowed. I'd handle duplicates this way if I needed to. Let me insert the quote I mean:
added 1 character in body
Source Link
Maksim Dmitriev
  • 1.4k
  • 3
  • 16
  • 29
  • An iterative version of insert is added. I expected the iterative approach would perform much faster than the recursive one. But when I inserted 50M nodes and then tried insertedinserting a duplicate key 100,000 times, the execution times of the recursive and iterative methods were almost the same. time = 37.703. timeIter = 33.909
  • Since I didn't find a tool for Eclipse which would build a DUG graph, I didn't do data flow testing.
  • An iterative version of insert is added. I expected the iterative approach would perform much faster than the recursive one. But when I inserted 50M nodes and then tried inserted a duplicate key 100,000 times, the execution times of the recursive and iterative methods were almost the same. time = 37.703. timeIter = 33.909
  • Since I didn't find a tool for Eclipse which would build a DUG graph, I didn't do data flow testing.
  • An iterative version of insert is added. I expected the iterative approach would perform much faster than the recursive one. But when I inserted 50M nodes and then tried inserting a duplicate key 100,000 times, the execution times of the recursive and iterative methods were almost the same. time = 37.703. timeIter = 33.909
  • Since I didn't find a tool for Eclipse which would build a DUG graph, I didn't do data flow testing.
added 3 characters in body
Source Link
Maksim Dmitriev
  • 1.4k
  • 3
  • 16
  • 29
Loading
Source Link
Maksim Dmitriev
  • 1.4k
  • 3
  • 16
  • 29
Loading