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

Enhancements for stack implementation using slice #544

Closed
wants to merge 7 commits into from

Conversation

BulkBeing
Copy link

Closes #543

structure/stack/stack_array.go Outdated Show resolved Hide resolved
structure/stack/stack_array.go Outdated Show resolved Hide resolved
raklaptudirm
raklaptudirm previously approved these changes Oct 2, 2022
Copy link
Member

@tjgurwara99 tjgurwara99 left a comment

Choose a reason for hiding this comment

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

I have a few general thoughts that I think might actually be better for this implementation.

First thing to note is that there is already an implementation of Stack. This means that to make this into a really self contained package, I think you should create an interface that both implementations adhere to and expose only the interface outside the package, but this is non-blocking.

The comment is blocking however.

structure/stack/stack_array.go Outdated Show resolved Hide resolved
package stack

import (
"container/list"
Copy link
Member

Choose a reason for hiding this comment

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

Please use our internal data structures when creating new ones. Using container package hides a lot of material that could be used for learning.

Copy link
Author

Choose a reason for hiding this comment

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

This code was already present (I just renamed the file). Since there is another implementation using linked list, shall I remove this one?

Copy link
Member

Choose a reason for hiding this comment

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

Keep it there, but create a new Issue to fix this 🙏🏼

}
})

st.Pop()
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be checked. Please fix all the listing and styling errors raised by the CI.

@github-actions
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Nov 30, 2022
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use slice appending instead of insertion at zeroth index in "stack array" implementation
3 participants