Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Kikobeats
Copy link

Instead of linked list.

I'm not sure about that but the implementation actually looks like list.

Maybe the commend was not updated?

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.

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.

Copy link

@abdulhannanali abdulhannanali left a 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.

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.

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.
  */

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.

3 participants