-
Notifications
You must be signed in to change notification settings - Fork 616
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
Update list reference #44
base: master
Are you sure you want to change the base?
Conversation
Instead of linked list.
@@ -748,8 +748,7 @@ class Stack { | |||
* rather than the end. Removing the oldest items rather than the most recent. | |||
* | |||
* Again, because this limits the amount of functionality, there are many | |||
* different ways of implementing it. A good way might be to use a linked list | |||
* which we will see later. | |||
* different ways of implementing it. A good way might be to use a list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be more relevant to the implementation presented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kikobeats Clarification from my side
@@ -748,8 +748,7 @@ class Stack { | |||
* rather than the end. Removing the oldest items rather than the most recent. | |||
* | |||
* Again, because this limits the amount of functionality, there are many | |||
* different ways of implementing it. A good way might be to use a linked list | |||
* which we will see later. | |||
* different ways of implementing it. A good way might be to use a list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kikobeats In this comment he isn't referring to the current implementation which is indeed using list and is O(N) but instead clarifying that a good way to implement them would be a linked list. Although, the sentence itself is ambiguous and can be clarified if the author wants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look out for the comment after the Queue implementation in which the author explains more about the current implementation and how it can be improved with the future Linked List implementation.
/**
* The important thing to note here is that because we used a list to back our
* queue it inherits the performance of "shift" which is linear O(N) "OKAY."
*
* Later we'll see linked lists that will allow us to implement a much faster
* Queue.
*/
Instead of linked list.
I'm not sure about that but the implementation actually looks like list.
Maybe the commend was not updated?