Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RakhmedovRS/3c97726e4aa77734d817947131b7696a to your computer and use it in GitHub Desktop.
Save RakhmedovRS/3c97726e4aa77734d817947131b7696a to your computer and use it in GitHub Desktop.
public class TreeNode {
/** Stores value in particular node */
int val;
/** Pointer to the left child of current node */
TreeNode left;
/** Pointer to the right child of current node */
TreeNode right;
/** Different constructors */
TreeNode() {}
TreeNode(int val) { this.val = val; }
TreeNode(int val, TreeNode left, TreeNode right) {
this.val = val;
this.left = left;
this.right = right;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment