lowest-common-ancestor-of-a-binary-search-tree 1.0.0
Lowest Common Ancestor of a Binary Search Tree
Loading...
Searching...
No Matches
TreeNode Struct Reference

Definition for a binary tree node. More...

Collaboration diagram for TreeNode:

Public Member Functions

 TreeNode (int x)
 

Data Fields

int val
 
TreeNodeleft
 
TreeNoderight
 

Detailed Description

Definition for a binary tree node.

Definition at line 8 of file main.cpp.

Constructor & Destructor Documentation

◆ TreeNode()

TreeNode::TreeNode ( int  x)
inline

Definition at line 13 of file main.cpp.

13: val(x), left(NULL), right(NULL) {}
int val
Definition main.cpp:10
TreeNode * left
Definition main.cpp:11
TreeNode * right
Definition main.cpp:12

Field Documentation

◆ left

TreeNode* TreeNode::left

Definition at line 11 of file main.cpp.

Referenced by Solution::lowestCommonAncestor().

◆ right

TreeNode* TreeNode::right

Definition at line 12 of file main.cpp.

Referenced by Solution::lowestCommonAncestor().

◆ val

int TreeNode::val

Definition at line 10 of file main.cpp.

Referenced by Solution::lowestCommonAncestor(), and main().


The documentation for this struct was generated from the following file: