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

Initial size needs to be as per the size of root i.e. 0 or 1 or n(if applicable) #108

Open
SmitaPatankar opened this issue Aug 5, 2021 · 0 comments

Comments

@SmitaPatankar
Copy link

self.size = 0

User is given flexibility to either create linked list with root as None or with a root node given by them.
i.e. size could be 0 or 1

If applicable:
User can also pass root that already has more next nodes.
i.e. size could be n

But, initial size is always set as 0 instead of calculating and setting it as per above logic

wvadhy added a commit to wvadhy/Python that referenced this issue Jul 29, 2022
Replaced if else conditionals with try except suite in order to catch IndexErrors if self.heap[1] is attempting to subscript and index out of bounds.

In response to issue joeyajames#108.
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

No branches or pull requests

1 participant