I recently watched your DSA playlist, which you uploaded about three years ago. Before starting, I had limited knowledge of DSA and was pressed for time in my studies. However, after watching all 92 videos, I now feel much more confident in my understanding of DSA. Your clear explanations and comprehensive content have made a significant difference in my learning journey. Thank you so much for creating this valuable resource!
I m happy before watching this video I have already implemented this exercise and it worked for first time only I do change some methods I apply my own logic and it worked greatly 😍😍
Those who get error in this code of segmentation fault should have to allocate the structure in heap memory Example:- int parenthesisMatch(char *exp){ struct stack *sp = (struct stack *)malloc(sizeof(struct stack)); // Same code }
The \0 is treated as NULL Character. It is used to mark the end of the string in C. In C, string is a pointer pointing to array of characters with \0 at the end.
Right.. I tried to implement stack without creating structure instance, but it did not run. On the other hand, when I created the structure instance, the code successfully ran. But, Harry bhai's code ran successfully without the structure instance, I did not get why it happened so..🤔🤔🤔🤔🤔🤔🤔🤔🤔
struct stack* sp; sp->size = 100; sp->top = -1; sp->arr = (char *)malloc(sp->size * sizeof(char)); entire structure doesn't need heap memory,only the chracter array has been given the dynamic memory that's why that complete dynamic allocation of struct is not there.
@@rishabhshahimishra If no memory is allocated for the structure, then where will the *sp pointer point to????? Only when a memory has been created in the heap, the *sp pointer will point to the allocated memory.
While coding, I've encountered a "Segmentation Fault" error which is resolved after using "struct Parenthesis * p= (struct Parenthesis *)malloc(sizeof(struct Parenthesis))" instead of "struct Parenthesis * p" only. Anyone else got such an error? btw, I've tried with my own code & it worked after some debugging. Thank you @codewithharry bhaiya !!!
I heard it somewhere "A SOCIETY GROWS WHEN THE OLD PEOPLE IN IT PLANT TREE ,IN THE SHADES OF WHICH THEY WILL NEVER SIT IN" So, t here was no harry in his tims But he is here FOR US 🙂😅😃😃
Hello harry bhai i think u got my message about DSALGO.... Please bhaiya im 2nd year it i want to learn dsalgo with u since no one can teach like u in this universe... Love u bhai
Bhai JavaScript Framework ke upar Ek combine video bnao jismein aap angular, react aur vue ka tips and tricks do ki Ham kisko choose Kare or fir uske upar aap course banoo, Main aapka web development ka JavaScript tutorials in Hindi ka course complete kar liya hai aur Mujhe front end web developer banna hai to front end web developer ke liye JavaScript and CSS frameworks bhi Aane chahie aur mujhe bahut jyada confusion ho rahi hai ki main JavaScript Framework kaunsa Sikho to please bhai kam karo.AUR EK VIDEO BANAO. My humble request to you. You are such a good teacher to teach programming languages that's why i am asking to you.
harry bahi jab hame sp pointer banaya to stack ke liye to koi memory hi heap me allocate ni karwae to fir sp->size me 100 kese store hora h aur top me bhi kese store hora h plz reply bro ..............🙏🙏🙏🙏
How to run this program i cant understand because when paranthesismatch function enter then required struct stack *sp=(struct stack*)malloc(sizeof(struct stack)); But there is not available in this code so how run this program tell me
ISO C++ forbids converting a string constant to 'char*' error while compiling Change char *exp = "(8*5)(2*3)()(9)"; to char exp[] = "(8*5)(2*3)()(9)"; But still have problem. Sometime don't get any output, when we increase the characters on char exp[] -_-
Harry bhaiya, $$$*************** 12:37 If the return type of pop function is char then how can you return -1 in pop function.. pls tellme. **********************$$$$
Sir, I'm learning a lot new stuff from you.....so far I have not done things practically because of some low end pc issues.....but finally I have decided to buy a programming laptop so can you suggest me a good programming laptop under 55k . . . .hope you will answer
when we take the input expression through cin in c++ in char pointer and then give it for parenthesis matching, it gives segmentation fault. But when we take a char array and take input in it, it doesn't give any error. Please answer my query. This is my code: #include #include using namespace std; struct stack { int size; int top; char *exp; }; void push(char c,stack **s) { (*s)->top++; (*s)->exp[(*s)->top]=c; } void pop(stack **s) { (*s)->top--; } int isEmpty(stack **s) { if((*s)->top==-1) return 1; return 0; } int main() { stack *s=new stack; s->top=-1; char *eq; printf("enter the expression:"); cin>>eq; char c; s->size=strlen(eq); s->exp=new char [s->size]; int i=0; do { c=eq[i++]; if(c=='(') push(c,&s); else if(c==')') { if(isEmpty(&s)) { printf("wrong expression "); break; } pop(&s); } else continue; }while (eq[i]!='\0'); if(isEmpty(&s)&&eq[i]=='\0') cout
please upload all topics of the data structures before moving to java because it will cause difficulty as we are dependent on u for this course and our rhythm will get break
*exp in the parenthesisMatch() takes the address of the first element of the character array exp from the main(), hence *exp in the parenthesisMatch () now points to the first element of the character array and now the subsequent elements can be accessed just as we access element of any array. This is an example of call by reference.
Bahut logo ko notifications nahi jaa rahi hain. Ye playlist bookmark kar lo!
th-cam.com/play/PLu0W_9lII9ahIappRPN0MCAgtOu3lQjQi.html
Harry bahi bahi bahi bahi bahi bahi bahi bahi bahi bahi bahi
Harry sir...❤️
how can I Hadoop setup on windows 8.1 Ram4GB
Harry brother java ki video 6pm tk de dijiye daily night me nind aa jata h jldi
Please please or facebook page pe message kiya h reply jrur dena aap
Sonu Bhaiya
This is awesome❤...harry bhai itne saarey new course la rhe ho...plz ds Algo ke course ko ignore mat kro...isko Jodi complete krwa do 🙏
I recently watched your DSA playlist, which you uploaded about three years ago. Before starting, I had limited knowledge of DSA and was pressed for time in my studies. However, after watching all 92 videos, I now feel much more confident in my understanding of DSA. Your clear explanations and comprehensive content have made a significant difference in my learning journey.
Thank you so much for creating this valuable resource!
This course is really taking advance position 💯
Sonu Bhaiya
No
@@JamesAzad binod
reply if you want to take advance position as well
I m happy before watching this video I have already implemented this exercise and it worked for first time only I do change some methods I apply my own logic and it worked greatly 😍😍
Congrats harry on reaching 1000 videos, GOOD LUCK
Those who get error in this code of segmentation fault should have to allocate the structure in heap memory
Example:-
int parenthesisMatch(char *exp){
struct stack *sp = (struct stack *)malloc(sizeof(struct stack));
// Same code
}
why code run for harry bhai without it (struct stack *)malloc(sizeof(struct stack));
@@viralvideoa want to know the same....a similar thing happened in one of his previous videos;
thanks brother......this comment of yours really helped me
harry bhai ka code kaise run kar raha hai yeh samajh nehi aaya
@@avronilbanerjee5302 i dont know r u using vs code as well ?
i am having this issue , i thought it's due to me using a different ide...
"Shru to majboori me kiya tha lekin ab mazjja aa raha hai "
Thank you very much SIR . Sare Dosto ko yahi video recommend Karunga.
The \0 is treated as NULL Character. It is used to mark the end of the string in C. In C, string is a pointer pointing to array of characters with \0 at the end.
Sir please reply, I'm a mechanical student from IIT BOMBAY and u r faar better than my computer teacher ,
Please reply sir
WHAT YOU WILL DO WITH HIS REPLY!! ENJOY LEARNING, WHEN U WILL ACHIEVE SOMETHING GREAT THAN GIVE HARRY SIR THE CREDIT.
Harry is the best, I like his video in starting kyonki harry ki koi bhi video bekar nahi hoti
You have made me fan of your teachings and hardwork.
Inspirational comes from you🙌🏻👨💻.
structure instance is missing.. struct stack *sp = (struct stack * ) malloc (sizeof(struct stack));
bilkul sahi pakde bhai
thank you bhai
Right.. I tried to implement stack without creating structure instance, but it did not run. On the other hand, when I created the structure instance, the code successfully ran. But, Harry bhai's code ran successfully without the structure instance, I did not get why it happened so..🤔🤔🤔🤔🤔🤔🤔🤔🤔
struct stack* sp;
sp->size = 100;
sp->top = -1;
sp->arr = (char *)malloc(sp->size * sizeof(char));
entire structure doesn't need heap memory,only the chracter array has been given the dynamic memory that's why that complete dynamic allocation of struct is not there.
@@rishabhshahimishra If no memory is allocated for the structure, then where will the *sp pointer point to????? Only when a memory has been created in the heap, the *sp pointer will point to the allocated memory.
While coding, I've encountered a "Segmentation Fault" error which is resolved after using "struct Parenthesis * p= (struct Parenthesis *)malloc(sizeof(struct Parenthesis))" instead of "struct Parenthesis * p" only. Anyone else got such an error? btw, I've tried with my own code & it worked after some debugging. Thank you @codewithharry bhaiya !!!
Yeah, bro. I faced this problem too and I did solve it in the same way as you did.
Sahi bataya aapne but Harry bhai ka code run kaise kiya fir
Thank you so much!
I heard it somewhere
"A SOCIETY GROWS WHEN THE OLD PEOPLE IN IT PLANT TREE ,IN THE SHADES OF WHICH THEY WILL NEVER SIT IN"
So, t here was no harry in his tims
But he is here FOR US 🙂😅😃😃
I have no words to express
Love you harry bhai💓
are bhaiya ye code ko me aur modify kra hu. now it acceps all types of brackets on my own before next video... thanks bhaiya to teach it
I started to code only because of ur html css playlist thanks for existing
very nicely explained by you bhai you are the best
So true he explains very nicely
❤️
Very good explanation........... Thanks Harry sir , everybody please support Sir because it takes time to make these excellent videos 👍👍
Your great sir you are best teaching others your tubers and teacher you are best for programing language you are grate sir 😎😎😎😎
Sir parenthesis bohot acche se samaj aa gaya kya mai aapko applaud karoo
Well done Harry bhai very good video 🔥🔥🔥. Hashing wagaira ke bhi video banao please 🙏🙏🙏
Hello harry bhai i think u got my message about DSALGO....
Please bhaiya im 2nd year it i want to learn dsalgo with u since no one can teach like u in this universe... Love u bhai
Thank u bhaiya itna acha content k liye👏👏
It was Difficult But Harry Bhai You 💖💖💖💖💖
well explained bhai
Best tutorial ever.✨😃☺️
this course is really good
Thank you so much for this valuable course🙏
watching your c programming and its awesome:)
Binod
Great Effort!
Sir we need a video series on react js and material ui sir big fan❤️❤️❤️
Harry bhai thanks for new Java series
What an amazing course❤️❤️🔥🔥...Thank you very much Sir!!❤️
Done with the paranthesis. thank you
Bhai JavaScript Framework ke upar Ek combine video bnao jismein aap angular, react aur vue ka tips and tricks do ki Ham kisko choose Kare or fir uske upar aap course banoo, Main aapka web development ka JavaScript tutorials in Hindi ka course complete kar liya hai aur Mujhe front end web developer banna hai to front end web developer ke liye JavaScript and CSS frameworks bhi Aane chahie aur mujhe bahut jyada confusion ho rahi hai ki main JavaScript Framework kaunsa Sikho to please bhai kam karo.AUR EK VIDEO BANAO. My humble request to you. You are such a good teacher to teach programming languages that's why i am asking to you.
Thanks a lot bhaiya,Loving your videos
Goat=harry bhai❤❤
You deserve millions subscribers.
7lakh subscribers soon.....
thank you for giving us this amazing course
while(worldExists){
cout
Thanks harry bhai ❤️❤️❤️❤️❤️❤️
12:00min
Done done
Bhai 1 million subscribers hone par ek personal video bnana jisme aap apne bare me btana 👍
u r a great teacher sir
Sir your code producing segmentation fault (core dumped) please check it???????
Thank you harry bhai for such awesome course 🙏🙏🙏
harry bahi jab hame sp pointer banaya to stack ke liye to koi memory hi heap me allocate ni karwae to fir sp->size me 100 kese store hora h aur top me bhi kese store hora h plz reply bro ..............🙏🙏🙏🙏
Harry bhai love you bro doing great work
Harry Bhai assembly language Please You Are The Best Teacher For Me 😍
O bhia assembly Jan lega kya bachhe ki
@@numlock3190 I Am Just 15 I Have No Money To Buy Premium Courses
Thanks Harry Bhaiya
Wow nice explaination Bhaiya.....!!!!!!!!!!!!!!!
I am shared this course❤❤
Awesome explanation harry bhai make more such videos
Mind-blowing harry bhiya
Sirji Tussi great ho 🤗♥️
Bro please make a video on 'Segmentation fault 11'.
Thanks a lot harry bhaiyya. Hope You cover up all heaps algorithms and all trees graphs
very good video bro . i liked it very much . keep going
STL is really very useful here using lists
Well done Harry bhai
bhai aap c++ me dsa ki videos bna dijiye......as we have learned directly from c++ course
Thank you sir ❤️🔥
bhai ki playlist best hai
How to run this program i cant understand because when paranthesismatch function enter then required struct stack *sp=(struct stack*)malloc(sizeof(struct stack));
But there is not available in this code so how run this program tell me
ISO C++ forbids converting a string constant to 'char*' error while compiling
Change
char *exp = "(8*5)(2*3)()(9)";
to
char exp[] = "(8*5)(2*3)()(9)";
But still have problem. Sometime don't get any output, when we increase the characters on char exp[] -_-
thanks its working can you explain the reason
also working if we change the Cout to printf
a=0
b=0
exp = "2+4*(42-0)*(44 +3*(44+3*(3) "
for i in exp:
if(i=='(')
a=a+1
elif(i==')'):
b=b+1
if(a==b):print("balanced")
else:print("not balbanced")
we can solve this like this right??
what will be time complexity?
Best teacher u r
Apki effort Ko Salam
Here's the parenthesis function by while loop :
int parenthesis(char *arr){
struct stack *sp;
sp->size = 100;
sp->top = -1;
sp->arr = (char*)malloc(sp->size*sizeof(char));
int i=0;
while(arr[i]!= '\0'){
if(arr[i]=='(')
push(sp,arr[i]);
else if(arr[i]==')'){
if(isEmpty(sp))
return 0;
pop(sp);
}
i++;
}
if(isEmpty(sp))
return 1;
else
return 0;
}
tq so much harry bhai
thank u so much sir
Harry bhaiya,
$$$*************** 12:37 If the return type of pop function is char then how can you return -1 in pop function..
pls tellme. **********************$$$$
Top Notch
Sir,
I'm learning a lot new stuff from you.....so far I have not done things practically because of some low end pc issues.....but finally I have decided to buy a programming laptop so can you suggest me a good programming laptop under 55k
.
.
.
.hope you will answer
asus vivobook
Harry bai ka kya khena🤓Cool Bro
Bro make advanced data structure and algorithms tutorial(hope so)......
when we take the input expression through cin in c++ in char pointer and then give it for parenthesis matching, it gives segmentation fault. But when we take a char array and take input in it, it doesn't give any error. Please answer my query. This is my code:
#include
#include
using namespace std;
struct stack
{
int size;
int top;
char *exp;
};
void push(char c,stack **s)
{
(*s)->top++;
(*s)->exp[(*s)->top]=c;
}
void pop(stack **s)
{
(*s)->top--;
}
int isEmpty(stack **s)
{
if((*s)->top==-1) return 1;
return 0;
}
int main()
{
stack *s=new stack;
s->top=-1;
char *eq;
printf("enter the expression:");
cin>>eq;
char c;
s->size=strlen(eq);
s->exp=new char [s->size];
int i=0;
do
{
c=eq[i++];
if(c=='(') push(c,&s);
else if(c==')')
{
if(isEmpty(&s))
{
printf("wrong expression
");
break;
}
pop(&s);
}
else continue;
}while (eq[i]!='\0');
if(isEmpty(&s)&&eq[i]=='\0')
cout
Awesome job
Bhai aaraha hai maza bohot
what should be done if we want to take input expression from user....
Thankyouu harry
Harry Bhai Dil Dy dy
thanks_Sir💜
please upload all topics of the data structures before moving to java because it will cause difficulty as we are dependent on u for this course and our rhythm will get break
Best teacher ever
Sonu Bhaiya
Sir I didn't understand why you took *exp pointer....and how a char pointer carrying string.... Please help me sir
*exp in the parenthesisMatch() takes the address of the first element of the character array exp from the main(), hence *exp in the parenthesisMatch () now points to the first element of the character array and now the subsequent elements can be accessed just as we access element of any array. This is an example of call by reference.
love you harry sir i am priyangsu
Harry bhai 👋👋
Harry sir plz reply..
I'm Ur biggest fan..
👍👍👍👍 helpful
Thankyou sir 😀
Bhai please machine learning course
Thank you sir. You are genius.
// Function for Parenthesis matching
void parenthesisMatch(char expression[]){
int sixeOfExp = 0;
while (expression[sixeOfExp]!='\0')
{
sixeOfExp++;
}
struct stack* sp = (struct stack*) malloc(sizeof(struct stack));
sp->size = sixeOfExp;
sp->elements = 0;
sp->top = NULL;
int iterator = 0;
while(expression[iterator] != '\0'){
if(expression[iterator] == '('){
PUSH(sp, '(');
}
else if(expression[iterator] == ')'){
if(isEmpty(sp)){
printf("1. Expression is unbalanced due to stack underflow!
");
return;
}
else{
POP(sp);
}
}
iterator++;
}
if(!isEmpty(sp)){
printf("2. Expression is unbalanced due to stack is not empty at EOE
");
}
else{
printf("Congratulations! Your expressin is balanced
");
}
}
quality content
sp->size =100;
it creates problem while running code. could you help to resolve it?
it is showing sp is uninitialized
Same here bro
Bhaiya, dsa with java ki videos chahiye 🙇🏻♂️