Skip to content

tests passing#35

Open
VeronicaO27 wants to merge 3 commits intoAda-C16:masterfrom
VeronicaO27:master
Open

tests passing#35
VeronicaO27 wants to merge 3 commits intoAda-C16:masterfrom
VeronicaO27:master

Conversation

@VeronicaO27
Copy link
Copy Markdown

Stacks and Queues

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

Comprehension Questions

Question Answer
What is an ADT?
Describe a Stack
What are the 5 methods in Stack and what does each do?
Describe a Queue
What are the 5 methods in Queue and what does each do?
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
Copy Markdown

@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.

Hi Veronica, I'm grading this as a red as your Stack implementation doesn't use a LinkedList which we do want you to practice using. We'd also like for you to make an attempt at the comprehension questions.

I'd be happy to regrade when you resubmit.

🔴

Comment thread stacks_queues/queue.py
@@ -23,39 +27,73 @@ def enqueue(self, element):
In the store are occupied
returns None
"""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/queue.py



def dequeue(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/queue.py
return self.store[self.front]


def front(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/queue.py
return self.store[self.front]


def size(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/queue.py
pass
return self.size

def empty(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/queue.py
else:
return False

def __str__(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/stack.py Outdated

def __init__(self):
self.store = LinkedList()
# self.store = LinkedList()
Copy link
Copy Markdown

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 with a list, the README does specifically ask you to use the LinkedList class in your implementation. The reason is that we want you to get more practice using (in addition to implementing) linked lists as they are commonly used in interviews.

Copy link
Copy Markdown

@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 work! Thanks for updating. For the difference between implementing v using. Implementing means to write or implement a function/piece of code yourself. Using means to just call or reuse code that someone else wrote/implemented. Think about when you use functions from a library or imported module or call an API, vs you implementing your own set of functions or your own API.

Let me know what questions you have!

🟢

Comment thread stacks_queues/stack.py
self.store = LinkedList()
# self.store = list()

def push(self, element):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/stack.py



def pop(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/stack.py
"""
pass

if self.store.length() == 0:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/stack.py
And False otherwise
"""
pass
if self.store.length() == 0:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread stacks_queues/stack.py
ending with the bottom of the Stack.
"""
pass
string_stack = self.store[::-1]
Copy link
Copy Markdown

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