-
Notifications
You must be signed in to change notification settings - Fork 4
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
Space - Shonda #1
base: master
Are you sure you want to change the base?
Conversation
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.
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.
const balanced = (str) => { | ||
throw new Error("This method has not been implemented!"); | ||
} | ||
const stack = []; |
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.
👍 Good use of a JS object as a hash!
Time Complexity: O(n) | ||
Space Complexity: O(n) | ||
*/ | ||
|
||
const balanced = (str) => { |
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.
👍
const expr = "35+6*"; | ||
console.log(evaluatePostfix(expr)); |
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.
const expr = "35+6*"; | |
console.log(evaluatePostfix(expr)); |
Time Complexity: O(n) | ||
Space Complexity: O(n) n for stack | ||
*/ | ||
const evaluatePostfix = (expr) => { |
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.
👍
dequeue() { | ||
throw new Error("This method has not been implemented!"); | ||
} | ||
dequeue() { |
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.
👍
enqueue(element) { | ||
throw new Error("This method has not been implemented!"); | ||
// enqueue(value) - Adds the value to the back of the queue. | ||
enqueue(element) { |
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.
👍
size() { | ||
return this.length; | ||
} |
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.
This should really return the number of elements in the Queue not the size of the underlying data structure.
isEmpty() { | ||
return ( | ||
this.store[this.head] === undefined || this.store[this.head] === null | ||
); | ||
} |
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.
👍
|
||
class Stack { |
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.
👍
No description provided.