How to draw the heap for an array in Java?


I have an assignment to draw the heap after an ArrayList and a LinkedList is created.

public static void main(String[] args) {      List list = new ArrayList();      list.add(0);      list.add(1);      list.add(1);      list.add(2); } 

and

public static void main(String[] args) {      List list = new LinkedList();     list.add(0);      list.add(1);      list.add(1);      list.add(2); } 

So far I have a tree set up for [0, 1, 1, 2] so that it just goes down like a tree from 0, 1 and 1, then 2. But I don’t know if that’s correct and if it’d be different for the ArrayList and LinkedList.