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

Space - Shonda #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Space - Shonda #1

wants to merge 2 commits into from

Conversation

Shonda860
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a 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.

Comment on lines 16 to +17
const balanced = (str) => {
throw new Error("This method has not been implemented!");
}
const stack = [];

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!

Comment on lines +12 to 16
Time Complexity: O(n)
Space Complexity: O(n)
*/

const balanced = (str) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +73 to +74
const expr = "35+6*";
console.log(evaluatePostfix(expr));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) => {

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() {

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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +32 to +34
size() {
return this.length;
}

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.

Comment on lines +37 to +41
isEmpty() {
return (
this.store[this.head] === undefined || this.store[this.head] === null
);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +2 to 3

class Stack {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants