Advertisement
Guest User

Untitled

a guest
Aug 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.21 KB | None | 0 0
  1. public void dfs() {
  2.         dfs(1);
  3.     }
  4.  
  5.     public void dfs(int index) {
  6.         if (index > pq.length - 1 || pq[index] == null)
  7.             return;
  8.         System.out.print(pq[index] + " ");
  9.         dfs(index * 2);
  10.         dfs((index * 2) + 1);
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement