Add a Queue and unit test.#2
Conversation
Still todo: move the SimpleQueue to the tests.
|
Bill, here's another try at the Queue addition I've been working on. |
| // Simple Queue - a trivial queue implementation used to verify tests. | ||
| // The head of the queue is at the beginning of the backing array. | ||
|
|
||
| function SimpleQueue() { |
There was a problem hiding this comment.
Why are there two Queue implementations? It seems the only difference is in the implementation.
There was a problem hiding this comment.
I was thinking the same thing. It should really be part of the tests, if
indeed it's still useful for testing. It was for a while, but probably no
longer useful.
We'll talk more tomorrow!
On Mon, Feb 29, 2016 at 11:06 AM, billbudge notifications@github.com
wrote:
In collections.js
#2 (comment):@@ -118,8 +118,79 @@ LinkedList.prototype.find = function(value) {
node = node.next;
}
return null;
+};
+
+//------------------------------------------------------------------------------
+// Simple Queue - a trivial queue implementation used to verify tests.
+// The head of the queue is at the beginning of the backing array.
+
+function SimpleQueue() {It's weird to have this exposed as part of the API, since it's not useful
as it stands. You don't appear to use it in your implementation of Queue
either.—
Reply to this email directly or view it on GitHub
https://github.com/billbudge/Diagrammar/pull/2/files#r54459708.
|
Removed the SimpleQueue (I think). |
Still todo: move the SimpleQueue to the tests.