Startet på 101
This commit is contained in:
parent
a78fac5f21
commit
d7d4601456
2 changed files with 39 additions and 0 deletions
6
symmetric-tree-101/Cargo.toml
Normal file
6
symmetric-tree-101/Cargo.toml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "symmetric-tree-101"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
33
symmetric-tree-101/src/main.rs
Normal file
33
symmetric-tree-101/src/main.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
// Definition for a binary tree node.
|
||||||
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
|
pub struct TreeNode {
|
||||||
|
pub val: i32,
|
||||||
|
pub left: Option<Rc<RefCell<TreeNode>>>,
|
||||||
|
pub right: Option<Rc<RefCell<TreeNode>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TreeNode {
|
||||||
|
#[inline]
|
||||||
|
pub fn new(val: i32) -> Self {
|
||||||
|
TreeNode {
|
||||||
|
val,
|
||||||
|
left: None,
|
||||||
|
right: None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Solution{}
|
||||||
|
|
||||||
|
use std::rc::Rc;
|
||||||
|
use std::cell::RefCell;
|
||||||
|
impl Solution {
|
||||||
|
pub fn is_symmetric(root: Option<Rc<RefCell<TreeNode>>>) -> bool {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue