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

Updation in MaxHeap.py #156

Open
Soyvor opened this issue Apr 11, 2024 · 0 comments
Open

Updation in MaxHeap.py #156

Soyvor opened this issue Apr 11, 2024 · 0 comments

Comments

@Soyvor
Copy link

Soyvor commented Apr 11, 2024

Naming Conventions: Renamed private methods to follow Python's naming conventions (snake_case).

Returning None: Changed the return value of peek and pop methods to None instead of False for clarity. In Python, None is typically used to indicate the absence of a value.

Use of Dummy Element: Initialized the heap with a dummy element at index 0 to simplify index calculations. This helps in avoiding special cases in the code.

Output Formatting: Changed the output printing to exclude the dummy element when printing the heap elements.

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