Skip to content

Conversation

@stephaniejmars
Copy link

Stacks and Queues

Thanks for doing some brain yoga. You are now submitting this assignment!

Comprehension Questions

Question Answer
What is an ADT? Abstract Data Type
Describe a Stack A stack is a kind of list that works in last in first out process, like a pile
What are the 5 methods in Stack and what does each do? pop, push, is empty, find, index search
Describe a Queue A queue is a kind of list that works in a last in first in first out process, like a line
What are the 5 methods in Queue and what does each do? enqueue, dequeue, find, is empty, is full
What is the difference between implementing something and using something?

OPTIONAL JobSimulation

Question Answer
Did you include a sample run of your code as a comment?

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.

The Queue works, but you did not implement it with a circular buffer. You also have problems with the paren-matching problem. Take a look and let me know what questions you have.

Comment on lines +3 to 5
# Time Complexity: O(n)
# Space Complexity: O(1)
def balanced(string)

Choose a reason for hiding this comment

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

This actually shouldn't work. It doesn't even look at the values in the string

@@ -1,28 +1,27 @@
class Queue

Choose a reason for hiding this comment

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

This works, but it's not implemented with a circular buffer. I suggest you review the notes on circular buffers and just verify that you understand how it works.

@@ -1,19 +1,19 @@
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

Development

Successfully merging this pull request may close these issues.

2 participants