Skip to content

Inconsistencies & lies in linked list problem #36

Open
@Flambino

Description

Overall, there's the question of whether this problem is about a linked list implementation or (more specifically) a deque implementation based on a doubly-link list. The problem is mixing the two terms a little willy-nilly.

But somewhat more worrisome: The first test is for a property named count (specifically that it's zero for an empty deque). But there are also tests for a countNodes() function. Either one would make sense on its own, but having both is strange, IMO. The function implies implementing something that walks the list, while the property implies that the deque's length should be tracked "manually".

(Okay, you could implement a dynamic count property using Object.defineProperty, or just return the property in countNodes, but the former that seems out-of-scope for the task, and the latter seems very redundant.)

And then there's this:

To keep your implementation simple, the tests will not cover error conditions. Specifically: pop or shift will never be called on an empty Deque.

Lies! There's a test specifically for that, actually.

The tests also seem to follow a different style than others: It's got 4 spaces of indentation, and could use some blank lines to breathe. The file you have to create is also (so far) the only camelCased filename I've come across, which made me raise an eyebrow - but I won't claim that's necessarily wrong. Just weird.

All in all, it just seems kinda messy.

I'd be happy to fix the stuff (don't know about the file name) - just let me know.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions