Skip to content

Some doubt in BuildMaxHeap #1

Closed
@krishnaexplore

Description

@krishnaexplore

seems not working BuildHeap

https://github.com/ramswaroop/Algorithms-and-Data-Structures-in-Java/blob/master/src/me/ramswaroop/common/MaxHeap.java#L49:L50
if we do some change here it is working
leftIndex = 2 * i ;
rightIndex = 2 * i + 1;

for input {5,12,64,1,37,90,91,97};
output should be : [97, 91, 90, 12, 37, 64, 5, 1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions