New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map for data structures #88
Conversation
Why did you call it |
I agree with @eush77, |
@@ -102,4 +102,18 @@ HashTable.prototype._increaseCapacity = function () { | |||
} | |||
}; | |||
|
|||
HashTable.prototype.map = function (fn) { | |||
var applyFunction = function (linkedList) { | |||
linkedList.map( function (elem) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter is complaining about this space before function
(to test it, run make
locally)
I had the same thought about the name, but I saw map was already used in linked lists so I just kept it for consistency. My local build didn't catch any of the syntax problems, but I think the problem was coming from running "make" as root. Thanks for the comments though, I'll make these changes soon. |
Yeah, you're right about the LinkedList map, I'll change it to forEach :) |
The best way I could think of to iterate through a heap in order was to copy the elements and call extract until it was empty, like heap sort. |
Thanks for the contribution @joshuacurl! I've merged it and changed somethings by myself as well:
|
No description provided.