pub struct TreeNode {
pub val: i32,
pub left: Option<Rc<RefCell<TreeNode>>>,
pub right: Option<Rc<RefCell<TreeNode>>>,
}
Expand description
Definition for a binary tree node.
Fields§
§val: i32
The value stored at this node
left: Option<Rc<RefCell<TreeNode>>>
Link to the left child if one exists
right: Option<Rc<RefCell<TreeNode>>>
Link to the right child if one exists
Implementations§
Trait Implementations§
impl Eq for TreeNode
impl StructuralPartialEq for TreeNode
Auto Trait Implementations§
impl Freeze for TreeNode
impl !RefUnwindSafe for TreeNode
impl !Send for TreeNode
impl !Sync for TreeNode
impl Unpin for TreeNode
impl !UnwindSafe for TreeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more