Skip to content
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

Adding bottom view binary tree problem solution #130

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace HashMap dependency with built-in Map
  • Loading branch information
karimelazzouni committed Oct 23, 2019
commit 14782016aa445b25b9fa6d14c9138f29ddb62cdb
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@
"eslint-plugin-import": "^2.14.0",
"jest": "^25.0.0"
},
"dependencies": {
"hashmap": "^2.4.0"
}
"dependencies": {}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const HashMap = require('hashmap');
const Queue = require('../../../Queue');

// Determines the bottom view of a binary tree
Expand All @@ -15,7 +14,7 @@ module.exports = function bottomView(binaryTree) {
const horizontalDistance = 0;

// create a map to track most recent visited nodes per hd
const hdToNodeValue = new HashMap();
const hdToNodeValue = new Map();

// perform bfs
const q = new Queue();
Expand Down