How to draw the heap for an array in Java?
Heap is an almost complete binary tree. So if you're planning to construct the tree you can just start by filling the values in the tree from top to down and left to right ie, proceed by filling nodes levelwise.
Arraylist or linked list doesn't matter here because both stored the level order traversal of the tree.
Ex. list.add(0), list.add(1), list.add(1), list.add(2), list.add(3), list.add(5)
                              0
                            /    \
                           1      1
                           / \     /
                         2   3  5