Struct leetcode_trees_rs::utils::TreeNode
source · pub struct TreeNode {
pub val: i32,
pub left: Option<Rc<RefCell<TreeNode>>>,
pub right: Option<Rc<RefCell<TreeNode>>>,
}
Expand description
The TreeNode signature is entirely 1:1 with LeetCode with additional optional features like serde.
Fields§
§val: i32
This uses normal i32 values that can be serialized and deserialized using serde if wanted.
left: Option<Rc<RefCell<TreeNode>>>
An optional smart pointer contained within a reference cell. This provides very useful functionality like internal mutability. The poiter can be represented as the left child node of a binary tree.
right: Option<Rc<RefCell<TreeNode>>>
An optional smart pointer contained within a reference cell. This provides very useful functionality like internal mutability. The poiter can be represented as the right child node of a binary tree.
Implementations§
Trait Implementations§
source§impl PartialEq for TreeNode
impl PartialEq for TreeNode
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