Open
Conversation
Instead of linked list.
Steakeye
reviewed
Dec 14, 2016
| * 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.
This appears to be more relevant to the implementation presented.
abdulhannanali
left a comment
There was a problem hiding this comment.
@Kikobeats Clarification from my side
| * 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.
@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.
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.
*/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of linked list.
I'm not sure about that but the implementation actually looks like list.
Maybe the commend was not updated?