Skip to content

Instantly share code, notes, and snippets.

@adderllyer
Last active August 29, 2015 13:57
Show Gist options
  • Save adderllyer/9362590 to your computer and use it in GitHub Desktop.
Save adderllyer/9362590 to your computer and use it in GitHub Desktop.
package com.ds.tree.adt;
public interface TreeTraversal {
/**
* visit binary tree pre-order
* @param root binary tree root node
*/
public String preOrder();
/**
* visit binary tree post-order
* @param root binary tree root node
* @return String nodes' value list
*/
public String postOrder();
/**
* visit binary tree in-order
* @param root binary tree root node
* @return String nodes' value list
*/
public String inOrder();
/**
* visit binary tree per level
* @param root binary tree root node
* @return String nodes' value list
*/
public String levelOrder();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment