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

C16 - Cedar - Afina Walton #1

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

Conversation

afinawalton
Copy link

No description provided.

Copy link

@kyra-patton kyra-patton left a comment

Choose a reason for hiding this comment

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

⚠️ While you did implement a queue and stack, the instructions request that you specifically use a circular buffer to implement your queue and a linked list to implement your stack. Apologies if the instructions didn't make this clear.

Let me know what questions you have.

🔴

@@ -0,0 +1,55 @@
function balanced(string) {

Choose a reason for hiding this comment

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

💫🌸 Impressive! You didn't need to implement this, but good work. I apologize for the confusion!

@@ -1,27 +1,33 @@
class Queue {
constructor() {

Choose a reason for hiding this comment

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

👀 While your implementation does work and utilize Javascript arrays effectively, the readme asks you to implement a queue using a circular buffer.

@@ -1,19 +1,20 @@
class Stack {

Choose a reason for hiding this comment

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

👀 While your implementation does work and utilize Javascript arrays effectively, unfortunately the readme requested you implement stacks using the included LinkedList class.

Choose a reason for hiding this comment

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

@afinawalton
Copy link
Author

afinawalton commented Apr 28, 2022

⚠️ While you did implement a queue and stack, the instructions request that you specifically use a circular buffer to implement your queue and a linked list to implement your stack. Apologies if the instructions didn't make this clear.

Let me know what questions you have.

🔴

@kp483 Hello! The README in the JavaScript version of this project includes a link with "See the Ruby version for details." that I honestly did not notice at all. So I didn't realize the project required a specific implementation.

In the future, is it possible to have these details added directly into the JavaScript README (rather than linked)?

I will re-do this project as soon as I can. Thank you.

@kyra-patton
Copy link

⚠️ While you did implement a queue and stack, the instructions request that you specifically use a circular buffer to implement your queue and a linked list to implement your stack. Apologies if the instructions didn't make this clear.
Let me know what questions you have.
🔴

@kp483 Hello! The README in the JavaScript version of this project includes a link with "See the Ruby version for details." that I honestly did not notice at all. So I didn't realize the project required a specific implementation.

In the future, is it possible to have these details added directly into the JavaScript README (rather than linked)?

I will re-do this project as soon as I can. Thank you.

Hi Afina, I agree the readme should be directly in the JavaScript version and have added it to our list of curriculum updates to implement. Additionally, I will be screening all future CS Fun projects to look out for this issue and be making changes as necessary. I apologize again that the JavaScript version was misleading and understand if you feel frustrated.

Take your time resubmitting; I'll look out for it and prioritize getting feedback to you quickly when you do.

Copy link

@kyra-patton kyra-patton left a comment

Choose a reason for hiding this comment

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

💪🏼 Nice changes to the Stack implementation!

@@ -1,19 +1,20 @@
class Stack {

Choose a reason for hiding this comment

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

}

isEmpty() {
if (!this.store.length) return true;
return false;
return this.store.isEmpty();
}

toString() {

Choose a reason for hiding this comment

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

👀 You might consider LinkedList's toString method instead!

const toRemove = this.store.getLast();
this.store.delete(toRemove);

return toRemove;
}

isEmpty() {

Choose a reason for hiding this comment

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

}

push(element) {
this.store.push(element);
this.store.addLast(element);
return;
}

pop() {

Choose a reason for hiding this comment

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

Copy link

@kyra-patton kyra-patton left a comment

Choose a reason for hiding this comment

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

🤠 Nice job Afina! Thanks for completing the project using a circular buffer and linked list respectively. I left a few comments on your new Queue implementation. Let me know what questions you have.

🟢

throw new Error("This method has not been implemented!");
this.store = new Array(20);
// front and rear are index refs
this.#front = this.#rear = 0;

Choose a reason for hiding this comment

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

✨ Curious as to why you chose to set the front and rear fields as private

constructor() {
// this.store = ...
throw new Error("This method has not been implemented!");
this.store = new Array(20);

Choose a reason for hiding this comment

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

👀 When implementing a circular buffer, it's often helpful to have a capacity field to enable users to set the size of the buffer (you'd want to set capacity as a parameter which can to default to 20)

Suggested change
this.store = new Array(20);
this.capacity = capacity
this.store = new Array(capacity);

else if (this.isEmpty()) {
this.store[this.#front] = element;
} else {
this.#rear += 1;

Choose a reason for hiding this comment

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

👀 Make sure you're handling the case where rear wraps around!

Suggested change
this.#rear += 1;
this.#rear = (this.#rear + 1) % this.capacity;

) {
throw 'QueueFullException'
}
else if (this.isEmpty()) {

Choose a reason for hiding this comment

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

✨ Nice use of your other methods!

this.store[this.#front] = null;

if (this.#front === this.#rear) {
this.#front = this.#rear = -1;

Choose a reason for hiding this comment

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

In your constructor, you initialize front and rear to zero. Make sure you stay consistent on this

Suggested change
this.#front = this.#rear = -1;
this.#front = this.#rear = 0;

this.#front += 1
}

return data;
}

front() {

Choose a reason for hiding this comment

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

}

front() {
throw new Error("This method has not been implemented!");
return this.store[this.#front];
}

size() {

Choose a reason for hiding this comment

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

}

size() {
throw new Error("This method has not been implemented!");
return this.store.length;
}

isEmpty() {

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
Development

Successfully merging this pull request may close these issues.

2 participants