File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Binary Tree traversal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Binary Tree traversal" Watch "Binary Tree traversal" New topic

Binary Tree traversal

Alec Sultana

Joined: Jan 02, 2012
Posts: 7
Hello and Happy new Year ^^

For my school assignment I built myself an AVL tree - it works as intended, however I need to represent the nodes and Data into Left-Data-Right representation, But I have no idea how to do it.

Left-Data-Right representation should be 3 columns. Left subtree's Data - current Node Data - Right subtree Data

Any suggestions would be appreciated

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36579
Welcome to the Ranch

Do you mean an in‑order depth traversal? You don’t usually print that in columns, but the principles are easy:-You can get different traversals by altering the order of parts 1 2 and 3
I agree. Here's the link:
subject: Binary Tree traversal
Similar Threads
Traversing the right branch of a binary tree.
Making binary tree: memory problem
When do i say that a binary search tree is unique?!
How to create a File Explorer using JTree
Identify the path of the node and insert in JTree.