Open
Conversation
added 2 commits
September 7, 2020 17:41
CheezItMan
reviewed
Sep 14, 2020
CheezItMan
left a comment
There was a problem hiding this comment.
Nice work Shonda, you hit all the learning goals here. Very well done on the circular buffer.
Let me know what questions you have on my comments.
Comment on lines
16
to
+17
| const balanced = (str) => { | ||
| throw new Error("This method has not been implemented!"); | ||
| } | ||
| const stack = []; |
There was a problem hiding this comment.
👍 Good use of a JS object as a hash!
Comment on lines
+12
to
16
| Time Complexity: O(n) | ||
| Space Complexity: O(n) | ||
| */ | ||
|
|
||
| const balanced = (str) => { |
Comment on lines
+73
to
+74
| const expr = "35+6*"; | ||
| console.log(evaluatePostfix(expr)); |
There was a problem hiding this comment.
Suggested change
| const expr = "35+6*"; | |
| console.log(evaluatePostfix(expr)); |
Comment on lines
+42
to
45
| Time Complexity: O(n) | ||
| Space Complexity: O(n) n for stack | ||
| */ | ||
| const evaluatePostfix = (expr) => { |
| dequeue() { | ||
| throw new Error("This method has not been implemented!"); | ||
| } | ||
| dequeue() { |
| enqueue(element) { | ||
| throw new Error("This method has not been implemented!"); | ||
| // enqueue(value) - Adds the value to the back of the queue. | ||
| enqueue(element) { |
Comment on lines
+32
to
+34
| size() { | ||
| return this.length; | ||
| } |
There was a problem hiding this comment.
This should really return the number of elements in the Queue not the size of the underlying data structure.
Comment on lines
+37
to
+41
| isEmpty() { | ||
| return ( | ||
| this.store[this.head] === undefined || this.store[this.head] === null | ||
| ); | ||
| } |
Comment on lines
+2
to
3
|
|
||
| class Stack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.