Skip to content

Conversation

InbarAbraham
Copy link
Owner

Updated the peek method to check if the heap contains at least one element before accessing self.heap[1]. This prevents a potential IndexError when the heap is empty.

Updated the `peek` method to check if the heap contains at least one element before accessing `self.heap[1]`. This prevents a potential IndexError when the heap is empty.
@InbarAbraham InbarAbraham merged commit abb7057 into master Jan 16, 2025
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.

1 participant