-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Stack using a fixed size array #5487
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
Conversation
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 seems like a duplicate of https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/stack.py.
https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/stack.py uses the Python list, I only use the Python list to simulate a fixed-sized array like the one in Java because Python doesn't have a built-in static array. It's a different implementation. I use the pointers to manage the list and resize it manually when it's full. Please have a look again, it's not a duplicate!! |
@dylanbuchi But |
@poyea Yes! I just don't use the built-in list methods or the resizing under the hood. So basically I'm simulating a static array using the list and the other one uses the list as-is: a dynamic array. I think it's helpful to also show this implementation. |
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.
data_structures/stacks/stack_fixed_size_array.py
What I was thinking is you may add this |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe your change:
New implementation of the stack data structure
Checklist:
Fixes: #{$ISSUE_NO}
.