Anyone have solve this plz... Write an Array based implementation of BST? 1. Insertion() 2. Deletion() 3. Search() 4. Inorder(), PreOrder(), PostOrder() 5. Height() 6. Write a Function to find the number of nodes at a specific height (given by user). 7. Write a function to count the leaf nodes in a BST......
Anyone have solve this plz...> **Write an Array based implementation of BST? 1. Insertion() 2. Deletion() 3. Search() 4. Inorder(), PreOrder(), PostOrder() 5. Height() 6. Write a Function to find the number of nodes at a specific height (given by user). 7. Write a function to count the leaf nodes in a BST......**
Hellow aman bhaya i have got some error exactly same code i have run which has been tought I have try to find the solution in google but not found. Can u provide me the solution aur why it is happening
Bhaiya class 12 jac ka computer science plzzz note video daaliye 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭😂😂😂🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭😭😭😭😭😭😭😭😭😭😂😂😂😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😭😭😭😭😭😭😭🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏plzzzzzzzzzzzzzzzzzzz
Error is - expected initializer before. '* ' tolen
This was found in
node * buildbst(int arr[],int start,int end)
{}
Awesome explanation
Where do we get our queries or doubt solved?
Especially came from this video?
Thank you 🙏🙏
bhaiya Nimcet exam preperation kai lie bhi video bana do.... koi bhi content provider nhi hai..... aap hi hit ho jaoge....
Bro , nimcet clear hogaya ?? Agar Huya/nahi to konsa clg liya ?? Same category se hai
@@PIYUSH-lz1zq bhai abhi 1st sem mein hu... bechlor degree kai
@@chirag_me mujhe v krni hai pr avi tk smjh ni aayekha senkru
ye question leetcode pe thora change h because sort array to bst wle function mein sirf do hi argument pass h ek *nums aur dusra numsSize
ek or function bana k solve kar le
*Thank you Dii*
we can see inorder for better checking
clear explanation thank you
class Solution {
public:
TreeNode* addNode(int l,int r,vector& nums){
if(l>r) return NULL;
int mid=(l+r)/2;
TreeNode* root=new TreeNode(nums[mid]);
root->left=addNode(l,mid-1,nums);
root->right=addNode(mid+1,r,nums);
return root;
}
TreeNode* sortedArrayToBST(vector& nums) {
return addNode(0,nums.size()-1,nums);
}
};
Matlab doubt clear karne ka ya DISCUSSION ka koi telegram channel ya aur kuch hai kya ?
hain ek
@@meme_eternity
Not needed now
Thanks !
Outstanding explanation 🔥
thanks a lot mam
Thanks a lot Maam!!! :)
Do we have notes for Treee playlist?
Strong brothers
thanks for such a nice explanation.
AVL trees approach ? Won't we used that?
Anyone have solve this plz...
Write an Array based implementation of BST?
1. Insertion()
2. Deletion()
3. Search()
4. Inorder(), PreOrder(), PostOrder()
5. Height()
6. Write a Function to find the number of nodes at a specific height (given by user).
7. Write a function to count the leaf nodes in a BST......
Aman bhaiya note nhi milta hai abhi 😔
bhaiya ye animation bahut funny tha lekin😂😂😂😂😂😂
Another name for this problem is "Building a BST from inorder sequence".
But. Inorder se wo balance nhi hojata
Compulsory nhi hai ki inorder wala balance tree ho
@@Npanywayme usne ye ni bola ki inorder se balance ho jaega, he said build a balanced tree from inorder sequence which is itself a sorted sequence
Apni kaksha pe bhi content daal do please
Very good explanation
bhaiya mai abhi 12 class mai hu mai apneee colege ke first year sai aaapki c++ coading learn kr luga
.
Please Do learn bro .. You wont regret even if you give 1 hr a day you will build a very strong future for you (if you found programming is for you**)
class Solution {
public:
TreeNode* func(TreeNode* &root, int ele)
{
if(!root)
return root= new TreeNode(ele);
if(root->val>ele)
{
root->left= func(root->left,ele);
}
else
{
root->right= func(root->right,ele);
}
return root;
}
TreeNode* bstFromPreorder(vector& preorder) {
TreeNode*root= NULL;
for(auto x:preorder)
{
func(root,x);
}
return root;
}
};
Hello EveryBody...If you are looking for the code..here it is :
TreeNode * ans(vectortrav , int start , int end){
if(start > end){
return NULL;
}
int mid =( start + end) / 2;
int midEle = trav[mid];
TreeNode *root = new TreeNode(midEle);
root->left = ans(trav , start , mid-1);
root->right = ans(trav , mid+1 , end);
return root;
}
//Inorder Traversal
void inorder(TreeNode * root , vector & trav){
if(root==NULL){
return;
}
inorder(root->left , trav );
trav.push_back(root->val);
cout
Anyone have solve this plz...>
**Write an Array based implementation of BST?
1. Insertion()
2. Deletion()
3. Search()
4. Inorder(), PreOrder(), PostOrder()
5. Height()
6. Write a Function to find the number of nodes at a specific height (given by user).
7. Write a function to count the leaf nodes in a BST......**
i think these videos are getting less likes as i am moving forward in this channel
i guesss this is because students are leaving as course is moving ;
Hellow aman bhaya i have got some error exactly same code i have run which has been tought
I have try to find the solution in google but not found. Can u provide me the solution aur why it is happening
class Solution {
public:
TreeNode* makeBST(vector&nums,int start,int end){
if(start>end)
return NULL;
int mid = (start+end)/2;
TreeNode *root = new TreeNode(nums[mid]);
root->left = makeBST(nums,start,mid-1);
root->right = makeBST(nums,mid+1,end);
return root;
}
TreeNode* sortedArrayToBST(vector& nums) {
TreeNode *res = makeBST(nums,0,nums.size()-1);
return res;
}
};
Kya koi bata skta hai ye didi kaun si hai😍😍😍
Shraddha Di..😊
@@rohanbhatia74 insta id?? hai kya
@@sachinbairi6353 yr shayad se ye insta nahi chalati kyuki mene dhundne ki kaafi koshish ki thi lekin nhi mili
Bhaiya class 12 jac ka computer science plzzz note video daaliye 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭😂😂😂🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭😭😭😭😭😭😭😭😭😭😂😂😂😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😂🙏😭😭😭😭😭😭😭🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏plzzzzzzzzzzzzzzzzzzz
🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
You have made a terrible mistake the diagram is wrong...the inorder traversal should be 10,20,30,40,50....and preorder would be 30,20,10,40,50