algorithms icon indicating copy to clipboard operation
algorithms copied to clipboard

data-structures bugs

Open tomcostello opened this issue 6 years ago • 0 comments
trafficstars

In Queue.js peek returns the last element added, not the earliest still in the queue.

In the test for Queue.js the contents are listed backwards in the test, so after enqueueing 1 and 2, the contents should be 2,1 not 1,2.

In Stack.js, the tests expect, and solution code returns undefined for peek on an empty stack rather than null.

In LinkedList.js tail is not set correctly in InsertAfter.

In LinkedList the ReadMe says "The delete method removes the first node with the specified value." but the code deletes all nodes with the given value.

tomcostello avatar Jul 04 '19 02:07 tomcostello