Leetcode 894. All Possible Full Binary Trees

  Рет қаралды 4,255

Code with Alisha

Code with Alisha

Күн бұрын

Пікірлер: 33
@probabilitycodingisfunis1
@probabilitycodingisfunis1 Жыл бұрын
unordered_mapdp; vector allPossibleFBT(int n) { if(n%2==0)return {}; if(n==1)return {new TreeNode()}; if(dp.find(n)!=dp.end())return dp[n]; vectorans; for(int i=1;ileft = l; node->right = r; ans.push_back(node); } } } return dp[n] = ans; }
@bajrangsinha2546
@bajrangsinha2546 9 ай бұрын
1) explanation up to mark, clear and concise. 2) no asking for like and subscribe. That's why i liked and subscribed to your channel. 3)quality content. 4) after watching your videos it gives me more confidence in dsa. Thanks 🙏
@priyabratadas2392
@priyabratadas2392 Жыл бұрын
Thank you !! Almost every problem seems simpler after its explained by you!!
@greatred2558
@greatred2558 Жыл бұрын
It’s good to see you again 😊
@Ujjwal7120
@Ujjwal7120 Жыл бұрын
I recently discovered this channel Wow your explanation are so simple and good
@aadil4236
@aadil4236 Жыл бұрын
You're back!! And with leetcode premium this time. Bade log. Good to see you back.
@leetcoder1159
@leetcoder1159 Жыл бұрын
Was missing you 😅 Leetcode Queen 👑
@p25_rhythm70
@p25_rhythm70 Жыл бұрын
nice to see you back your explanations are very good and on point
@OpeLeke
@OpeLeke 11 ай бұрын
Thanks Alisha
@tindo0038
@tindo0038 2 ай бұрын
amazing explanation. thank you.
@leetcoder1159
@leetcoder1159 Жыл бұрын
One video on how to improve communication skills for coding interview
@manishkumar-uw5mw
@manishkumar-uw5mw Жыл бұрын
Good to see you again 🥳🥳
@shivanshgupta1509
@shivanshgupta1509 Жыл бұрын
Welcome back!!
@Idukhan-jj9kc
@Idukhan-jj9kc Жыл бұрын
Ma'am good to see🎉🎉please continue
@sayansen0361
@sayansen0361 Жыл бұрын
Happy belated teacher's day ma'am
@Code_express
@Code_express Жыл бұрын
finally after many days
@mayankshakya9200
@mayankshakya9200 Жыл бұрын
When you completed yr btech and from where ?
@AnujSharma-ro4kc
@AnujSharma-ro4kc Жыл бұрын
Welcome back after sooo long 😊
@raushankumar6993
@raushankumar6993 Жыл бұрын
Welcome back☺☺
@HuzaifaBilal-fo7zc
@HuzaifaBilal-fo7zc 6 ай бұрын
Make video on Print combinations of r elements in an array of size n
@srivastavkumar5497
@srivastavkumar5497 6 ай бұрын
Thank you mam
@dharmeshpanchal1642
@dharmeshpanchal1642 10 ай бұрын
Fantastic 🎊👌👌
@anshulgoel1940
@anshulgoel1940 Жыл бұрын
Why is no one talking about time complexity ?
@mustafizurrahman1560
@mustafizurrahman1560 Жыл бұрын
This channel is alive?
@mukulkhanna5071
@mukulkhanna5071 3 ай бұрын
can anyone pls share time complexity??? I am bit confused
@ASHUTOSHSHARMA-h4w
@ASHUTOSHSHARMA-h4w 6 ай бұрын
God made you beautiful and intelligent ❤. Thank you for the help
@Abubakar91718
@Abubakar91718 10 ай бұрын
message to all learner, dont forget to subscribe to this channel.
@harshmishra3524
@harshmishra3524 Жыл бұрын
jai shree ram
@DURGESHKUMAR-pu4wq
@DURGESHKUMAR-pu4wq Жыл бұрын
I thought you forgot your Chanel password 😂
@probabilitycodingisfunis1
@probabilitycodingisfunis1 Жыл бұрын
😂😂😂
@TheViral_fyp
@TheViral_fyp 5 ай бұрын
Are you alive Mam ?
@mathematics6199
@mathematics6199 8 ай бұрын
Didi did you got laid off from ms?
@ozzy-fr7vj
@ozzy-fr7vj 2 ай бұрын
Rust implementation -> // Definition for a binary tree node. // #[derive(Debug, PartialEq, Eq)] // pub struct TreeNode { // pub val: i32, // pub left: Option, // pub right: Option, // } // // impl TreeNode { // #[inline] // pub fn new(val: i32) -> Self { // TreeNode { // val, // left: None, // right: None // } // } // } use std::{rc::Rc, cell::RefCell, collections::HashMap}; type T = Option; macro_rules! treeNode { ($n:expr) => { Some(Rc::new(RefCell::new(TreeNode::new($n)))) }; ($a:expr, $b:expr) => { Some(Rc::new(RefCell::new(TreeNode { val: 0, left: $a, right: $b, })))}; } impl Solution { pub fn all_possible_fbt(n: i32) -> Vec { fn bk(n: i32, dp: &mut HashMap) -> Rc { match n { 0 => dp.get(&0).unwrap().clone(), 1 => dp.get(&1).unwrap().clone(), _ if dp.contains_key(&n) => dp.get(&n).unwrap().clone(), _ => { let mut res = Vec::new(); for l in (1..n).step_by(2) { let r = n - 1 - l; for t1 in bk(l, dp).iter() { for t2 in bk(r, dp).iter() { res.push(treeNode!(t1.clone(), t2.clone())); } } } let res = Rc::new(res); dp.insert(n, res.clone()); res } } } let result = bk( n, &mut HashMap::from([ (0, Rc::new(Vec::::new())), (1, Rc::new(vec![treeNode!(0)])), ])); Rc::try_unwrap(result).unwrap() } }
Leetcode 2392. Build A Matrix With Conditions | Weekly Contest 308.
27:46
Code with Alisha
Рет қаралды 3,4 М.
Minimum Height Trees - Leetcode 310 - Python
23:30
NeetCodeIO
Рет қаралды 20 М.
إخفاء الطعام سرًا تحت الطاولة للتناول لاحقًا 😏🍽️
00:28
حرف إبداعية للمنزل في 5 دقائق
Рет қаралды 83 МЛН
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 12 МЛН
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 26 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 124 МЛН
979. Distribute Coins in Binary Tree | Tricky DFS | Recursion
17:24
Aryan Mittal
Рет қаралды 4,6 М.
The Tri Folding Phone Impressions!
11:18
Marques Brownlee
Рет қаралды 3,2 МЛН
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 148 М.
Leetcode 2401. Longest Nice Subarray | Weekly Contest 2401.
19:54
Code with Alisha
Рет қаралды 6 М.
Binary Search in Java - Full Simple Coding Tutorial
17:48
Coding with John
Рет қаралды 122 М.
Leetcode 5. Longest Palindromic Substring
23:52
Code with Alisha
Рет қаралды 48 М.
إخفاء الطعام سرًا تحت الطاولة للتناول لاحقًا 😏🍽️
00:28
حرف إبداعية للمنزل في 5 دقائق
Рет қаралды 83 МЛН