Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void dfs() {
- dfs(1);
- }
- public void dfs(int index) {
- if (index > pq.length - 1 || pq[index] == null)
- return;
- System.out.print(pq[index] + " ");
- dfs(index * 2);
- dfs((index * 2) + 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement