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

Print binary heap in tree form #53

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

Print binary heap in tree form #53

wants to merge 5 commits into from

Conversation

adeet1
Copy link

@adeet1 adeet1 commented Jan 1, 2020

This pull request improves the print() method in binary_heap.cpp by printing the heap as a tree instead of as an array, making it easier to visualize the heap.

createTree() is a helper method, which iterates through each element in the heap array to create a binary tree from the array.

Notes:

  1. The print functionality itself is taken from lab 5.
  2. Please ignore commit 05dc0cb, as it is a duplicate of the commit in the previous pull request.

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