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

Please accept the pull request I had done some changes in the codes of stack #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TanyaAgarwal28
Copy link

No description provided.

it's more sensible in terms of inheritance. The fact that Stack extends Vector is really strange.Early in Java, inheritance was overused IMO - Properties being another example.

Deque exposes a set of operations which is all about being able to fetch/add/remove items from the start or end of a collection, iterate etc - and that's it. There's deliberately no way to access an element by position, which Stack exposes because it's a subclass of Vector.

Oh, and also Stack has no interface, so if you know you need Stack operations you end up committing to a specific concrete class, which isn't usually a good idea.

And earlier r.peek()<temp was sorting the stack in descending order so I had changed it to r.peek()>temp now it is sorting a stack in ascending order
@TanyaAgarwal28 TanyaAgarwal28 changed the title Code of TowerOfHanoi for input taken from the user Please accept the pull request I had done some changes in the codes of stack Mar 10, 2021
@Forest-Cxh
Copy link

Forest-Cxh commented Mar 11, 2021 via email

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.

None yet

2 participants