Conversation
kyra-patton
left a comment
There was a problem hiding this comment.
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.
🔴
| @@ -23,39 +27,73 @@ def enqueue(self, element): | |||
| In the store are occupied | |||
| returns None | |||
| """ | |||
|
|
||
|
|
||
|
|
||
| def dequeue(self): |
| return self.store[self.front] | ||
|
|
||
|
|
||
| def front(self): |
| return self.store[self.front] | ||
|
|
||
|
|
||
| def size(self): |
| pass | ||
| return self.size | ||
|
|
||
| def empty(self): |
| else: | ||
| return False | ||
|
|
||
| def __str__(self): |
stacks_queues/stack.py
Outdated
|
|
||
| def __init__(self): | ||
| self.store = LinkedList() | ||
| # self.store = LinkedList() |
There was a problem hiding this comment.
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.
kyra-patton
left a comment
There was a problem hiding this comment.
✨ 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!
🟢
| self.store = LinkedList() | ||
| # self.store = list() | ||
|
|
||
| def push(self, element): |
|
|
||
|
|
||
|
|
||
| def pop(self): |
| """ | ||
| pass | ||
|
|
||
| if self.store.length() == 0: |
| And False otherwise | ||
| """ | ||
| pass | ||
| if self.store.length() == 0: |
| ending with the bottom of the Stack. | ||
| """ | ||
| pass | ||
| string_stack = self.store[::-1] |
Stacks and Queues
Thanks for doing some brain yoga. You are now submitting this assignment!
Comprehension Questions
OPTIONAL JobSimulation