Pata nahi log ise kyu nahi dekh rahe maine ye start ki h to 1 week bhi nahi hua h and 30 videos complete kar li hai with practice. Sir aapse hi seekh rahe hai varna baki teachers to only theory hi batate hai , theory + with practice jyada Better hai thanks sir ise banane ke liye. Aapko pata hai hame kaha problem ho sakti hai .
Function to print the bottom-most element in the stack Code: void stackBottom(){ if(isEmpty(top)){ printf("Stack Underflow! "); } else{ node* ptr = top; while(ptr->next != NULL){ ptr = ptr->next; } printf("Bottom-most element in the stack is %d ",ptr->data); } }
in (stackbottom)function we will run a while loop till (ptr->next!=NULL) and when we came out of the loop it will point to the last node and value at that node will give us the desired bottom value of the stack
int stackbottom(struct Node *sb){ while(sb->next != NULL){ sb=sb->next; } return sb->data; } printf("bottom element is :- %d ",stackbottom(top)); Edited :- make sure your "top" is struct variable and it is set null
I have made a slight different peek function. it's for finding the position of a particular element in the linked list. Just the opposite of normal peek function. Here it is -- int peek(struct node *pt, int x) { int i = 1; while(pt->data!=x) { pt = pt->next; i++; } printf(" The value %d was found at index %d ",x, i);
this one is not peek function - peek function takes an index and returns the value at index - your function takes an value and returns the index of that value
void stackbottom(struct node*top) { struct node*p=top; while (p->next!=NULL) { p=p->next; } printf("Bottom most element of the stack is %d ",p->data); }
@Abdullah basically when you want to print the last element from the linked list we traversed till the last Node . Not the NuLL onces. Because as we know that stack bottom will be the first element in the stack as it follows LIFO so that's why. But when we have to print each and every Node then only we use p!=NULL as this will reach to end means fully end of the linked list. And P->next != Null means that the last value of that linked list.
Function to print the bottom-most element in the stack Code: int stackBottom(){ if(isEmpty(top)){ printf("Stack Underflow! "); } else{ node* ptr = top; while(ptr->next != NULL){ ptr = ptr->next; } printf("Bottom-most element in the stack is %d ",ptr->data); } }
Stack Bottom: For implementation I had created a stack* so as to dynamically allocate stack hence using stack** for copy by reference void bottom(stack** p){ if((*p)->top == NULL) return; node* t = (*p)->top; while(t->next != NULL){ t = t->next; } printf("The Data first inserted was : %d ",t->data); }
Bhai agar ham deletion and insertion at start for linked list for pop and push respectively along with the checks for underflow and overflow we could implement the same simply by knowing the Linked list u taught beautifully
Function for stack bottom. int stackBottom(struct Node *s) { if (isEmpty(s) == 1) { return -1; } while (s->next != NULL) { s = s->next; } return s->data; }
StackBottom() operation of stack using linked list in c language: int stackBottom(struct Node* top){ struct Node* ptr=top; while(ptr->next!=NULL){ ptr=ptr->next; } return ptr->data; }
int stackBottom(struct Node *top) { struct Node *ptr = top; for (int i = 0; (i < 3); i++) { ptr = ptr->next; } return ptr->data; } printf("The Bottom element of the stack is %d", stackBottom(top));
Harry bhai ek request hai. Can you please make a tutorial on database management system as well If your answer is yes then please reply to me. I have watched many of your tutorials
8:50
stackBottom Function::
int stackBottom (struct Node*top) {
struct Node*ptr=top;
while (ptr->next!=NULL) {
ptr=ptr->next;
}
return ptr->data;
}
I left my NPTEL DSA course as I like your way of teaching... more than anyone else. Hats off.. Harry Bhai
Really you are one of the greatest teacher I met in my life.
When did you met him😒😒...huh...when...you saw him only
Same
❤️
JAVA playlist laane ke liye thank u harry bhai😍💞
Java is huge.. but awasome.. learn java MVC like Spring, Hibernate ...
Everyone should learn python
@@ravikanttiwari6623 aati hai python 😇
Ek hi din me different languages k video.i. e., C, java, data structures..
Maan gae sir ji apke hrdwrk ko.👍👍
31 videos done.....61 left...learning... Enjoying... Thank you Harry.
Mine also 😀
Pata nahi log ise kyu nahi dekh rahe maine ye start ki h to 1 week bhi nahi hua h and 30 videos complete kar li hai with practice. Sir aapse hi seekh rahe hai varna baki teachers to only theory hi batate hai , theory + with practice jyada Better hai thanks sir ise banane ke liye. Aapko pata hai hame kaha problem ho sakti hai .
8:38
int stackBottom(struct Node *top){
struct Node *ptr = top;
while(ptr->next != NULL){
ptr = ptr->next;
}
return ptr->data;
}
Function to print the bottom-most element in the stack
Code:
void stackBottom(){
if(isEmpty(top)){
printf("Stack Underflow!
");
}
else{
node* ptr = top;
while(ptr->next != NULL){
ptr = ptr->next;
}
printf("Bottom-most element in the stack is %d
",ptr->data);
}
}
Thanks a lot brother ❤@thanoz6003
your videos are so better than many online courses. :) Thank you for uploading them.Its a great cause.
in (stackbottom)function we will run a while loop till (ptr->next!=NULL) and when we came out of the loop it will point to the last node and value at that node will give us the desired bottom value of the stack
8:59-int stack bottom(struct Node *top)
{
struct Node *ptr=top;
while(ptr->next!=Null)
{
ptr=ptr->next;
}
return ptr->data;
}
You are best programmer in you tube.
Awesome lectures learning a lot
Stack bottom:
Int stackBottom(struct node*ptr)
{ If(isEmpty(top))
{ Printf("stack is empty");
Return -1;
}
Else
{
While (top->next!=NULL)
{ top=top->next;
}
Return top->data;
}
8:55
int stackBtm(struct node* top){
struct node* p = top;
while (p->next!=NULL)
{
p=p->next;
}
return p->data;
}
StackBottom (struct Node*top)
{ Struct Node* p=top;
While (p->next != NULL)
{
P=P->next;
} Return p->data;
int kon lagayega😂😂
Your dedication inspires me a lot...Thank you for the beautiful content
stackBottom done sir. Here 'top' is global variable
int stackBottom(void)
{
struct Node *ptr = top;
while (ptr->next != NULL)
{
ptr = ptr->next;
}
return ptr->data;
}
Harry vaii you are my superhero ❤️
Thank you Sir for these free content ❣️👍🏻
all clear Sir!
Function for Stack Bottom ----->
int stack_bottom(struct Node * t){
while(t->next != NULL){
t = t->next;
}
if(t->next == NULL){
return t->data;
}
return -1;
}
Thank you so much Harry Bhai subkuch free sikha denge ap. Excellent coder in the world.
You are great sir, i appreciate your effort , thank you very much 😊😊
8:47 - stackBottom() implementation
int stackBottom(Node *top){
Node *ptr = top;
while(ptr->next!=NULL){
ptr = ptr->next;
}
return ptr->data;
}
@8:50
int stackBottom(struct node *ptr)
{
struct node *p;
p = ptr;
while (p->next != NULL)
{
p = p->next;
}
return p->data;
}
int stackbottom(struct Node *sb){
while(sb->next != NULL){
sb=sb->next;
}
return sb->data;
}
printf("bottom element is :- %d
",stackbottom(top));
Edited :- make sure your "top" is struct variable and it is set null
8:35 int StackBottom(struct Node*top){
struct Node*p=top;
while(p->next!=NULL){
p=p->next;
}
return p->data;
}
Stack bottom:
8:48
int StackBottom(node* top){
node *ptr = top;
while(ptr != NULL){
ptr = ptr->next;
}
if(ptr != NULL){
return ptr->data;
}
else{
return -1;
}
}
8:50
struct node *ptr = top;
while((*ptr).next)
ptr = (*ptr).next;
return (ptr->data); // --> Bottom most element
Harry bhai the *best*
Sir thanks for the course 🙏🙏🙏
Harry Bhai you already have 581K subscribers. We want a party when it get's to 600K.
Don't forget the party!!
*Gajab padhate ho !!!*
int stackBottom(struct Node*top)
{
struct Node * p = top;
while(p->next != NULL)
{
p =p ->next;
}
return p -> data;
}
10:18 #problem : - top is undefiend
8:50 challenge accepted
int stackBottom(struct node *ptr){
while(ptr->next!=NULL){
ptr=ptr->next;
}
return ptr->data;
}
great sir .... you made my life easy
Dont stop uploading data structure please 🥺🥺
I have made a slight different peek function. it's for finding the position of a particular element in the linked list. Just the opposite of normal peek function. Here it is --
int peek(struct node *pt, int x)
{
int i = 1;
while(pt->data!=x)
{
pt = pt->next;
i++;
}
printf("
The value %d was found at index %d
",x, i);
if you use 'int' (int peek(...)) then you have to return something.
you should also include the case when that value is not equal to any data of linked list
this one is not peek function
- peek function takes an index and returns the value at index
- your function takes an value and returns the index of that value
It is not peek function Bruh!!! .Your Function is searching position of data so it is like binary search.
@@manthangevariya1435 That is what he said bro....It is a slightly different peak function😶
Your videos are awesome and I'm sharing your videz
void stackbottom(struct node*top)
{
struct node*p=top;
while (p->next!=NULL)
{
p=p->next;
}
printf("Bottom most element of the stack is %d
",p->data);
}
Stack bottom( ){
Node *p = top;
while(p->next!=NULL){
p=p->next;
}
return p->data;
}
@Abdullah basically when you want to print the last element from the linked list we traversed till the last Node . Not the NuLL onces. Because as we know that stack bottom will be the first element in the stack as it follows LIFO so that's why. But when we have to print each and every Node then only we use p!=NULL as this will reach to end means fully end of the linked list. And P->next != Null means that the last value of that linked list.
@Abdullah yup basically when p==NULL then it will come out the loop , but when p->next == NuLL means Null se phela wala.
int stackBottom(node* top){
node* ptr=top;
while(ptr->next!=NULL){
ptr=ptr->next;
}
if(ptr!=NULL){
return ptr->data;
}
else{
return -1;
}
}
Homework completed sire 😊 😊
Waiting for AWS full course in same energy :D And I wish you were my teacher in college.
8:41
Home-Work Hogaya bhaiya 😅😅
int stackBottom(struct Node *top)
{
struct Node* ptr = top;
while (ptr->next != NULL)
{
ptr = ptr->next;
}
return ptr->data;
}
Function that returns the bottom most element of stack
int stackBottom(Node* top)
{
if(isEmpty(top))
{
coutnext!=NULL);
return p->data;
}
}
Thanks sir for datastructure series
Program-stackbottom()
Int stackbottom()
{
Struct Node *n=top;
while(n!=NULL)
{
n=n->next;
}
return n->data;
}
Kya baat 😁
This code is wrong bro, in while condition you need to type n->next != NULL .
@@manishsemwal1777 yes, & argument pass nahi kiya
@@manishsemwal1777 bro can you please tell me why this so
8:42
// Function to print the stack bottom
void stack_bottom(struct node *t){
struct node *ptr=top;
while(ptr->next!=NULL){
ptr=ptr->next;
}
printf("BOTTOM = %d
", ptr->data);
}
Function to print the bottom-most element in the stack
Code:
int stackBottom(){
if(isEmpty(top)){
printf("Stack Underflow!
");
}
else{
node* ptr = top;
while(ptr->next != NULL){
ptr = ptr->next;
}
printf("Bottom-most element in the stack is %d
",ptr->data);
}
}
8:46
int stackBottom(struct Node *top)
{
struct Node *ptr = top;
while(ptr->next!=NULL)
ptr = ptr->next;
return ptr->data;
}
Goat= harry bhai❤❤
//implementing stack bottom function
void stackBottom(struct node* top){
struct node* indexpointer;
indexpointer=top;
while(indexpointer->next!=NULL){
indexpointer=indexpointer->next;
}
cout
8:55 while ptr-> next!=NULL; ptr=ptr->next; exit loop print ptr->data;
Stack Bottom:
For implementation I had created a stack* so as to dynamically allocate stack hence using stack** for copy by reference
void bottom(stack** p){
if((*p)->top == NULL) return;
node* t = (*p)->top;
while(t->next != NULL){
t = t->next;
}
printf("The Data first inserted was : %d
",t->data);
}
8:46
int bottom(node* ptr) {
while(ptr->next!=NULL){
ptr= ptr->next;
}
return ptr->data;
}
8:51
//Stack Bottom Implementation in C++
Node *stackBottom(Node *top){
Node *p = top;
while(p->next!=NULL){
p = p->next;
}
return p->data;
}
God bless you 😇❤you are blessing for others keep uploading Jazak Allah ❤❤❤
int stackBottom(struct Node* top){
struct Node *k = top;
while (k->next != NULL)
{
k = k->next;
}
return k->data;
}
@Harsh Chopra shi hai bro
@Harsh Chopra sahi hai
you can use this function without struct Node *top ==> parameters too. as top is already declared as Global variable.
@@raht9578 hi banss
@@shelbys1533 oh wow
sare data structure samajh aa rhe he harry bhai
8:45 Homework: stackBottom function in Linked list
stackBottom(){
struct node*ptr = top;
while(ptr!= NULL){
ptr = ptr -> next; }
return ptr -> data; }
Greatt work 👍👍
8:46 Stack Bottom:
while(ptr->next!=NULL){
ptr=ptr->next;
}
return ptr->data;
Harry bhaiya done with this thank you
Bhai agar ham deletion and insertion at start for linked list for pop and push respectively along with the checks for underflow and overflow we could implement the same simply by knowing the
Linked list u taught beautifully
stackBottom Function:
int stackBottom(struct node * ptr){
while(ptr->next != NULL){
ptr = ptr->next;
}
return ptr->data;
}
thankyou so much herry sir this playlist very helpful for me
Thank you harry bhai for such awesome course
Function for stack bottom.
int stackBottom(struct Node *s)
{
if (isEmpty(s) == 1)
{
return -1;
}
while (s->next != NULL)
{
s = s->next;
}
return s->data;
}
correct code
int stackBottom(struct Node *top){
if(isEmpty(top)){
printf("stack is empty:stack underflow
");
return -1;
}
else{
struct Node *ptr = top;
do{
ptr = ptr->next;
}while(ptr->next!= NULL);
return ptr->data;
}
}
StackBottom() operation of stack using linked list in c language:
int stackBottom(struct Node* top){
struct Node* ptr=top;
while(ptr->next!=NULL){
ptr=ptr->next;
}
return ptr->data;
}
Great work..learned a lot from you.
int StackBottom()
{
struct Node* ptr= top;
while(ptr->Next!=NULL)
{
ptr=ptr->Next;
}
return (ptr->data);
}
int StackBottom(struct Node* top)
{
Node* temp = top;
while(temp->next != nullptr)
{
temp = temmp->next;
}
return temp->data;}
}
8:42
STACK BOTTOM
int stackBottom(struct node *top)
{
struct node *ptr = top;
while (ptr->next != NULL)
{
ptr = ptr->next;
}
return ptr->data;
}
Thank you sir for such awesome content .respect your hardwork man
8:48
int stackBottom()
{
struct Node * ptr = (struct Node *)malloc(sizeof(struct Node *));
ptr->next = top;
while (ptr->next != NULL){
ptr = ptr->next;
}
return ptr->data;
}
8:33 // Home Work
int stackBottom(struct Node* top){
if(isEmpty(top)){
printf("Stack is Underflow:(
");
return -1;
}
while(top->next!=NULL){
top=top->next;
}
return top->data;
}
top is not global variable so why peek is ablae to use it even without passing that.plz reply .
8:59
stackBottom
while(top->next != NULL)
{
top= top->next;
}
printf("%d",top->data);
Code for stackButtom :
int stackButtom(node *top){
node *ptr=top;
while(ptr->next!=NULL){
ptr=ptr->next;
}
int a=ptr->data;
return a;
}
Harry bhai apne is dsa course mein sirf 12 pdf dali apke download notes ki or kaha hai
Please btao harry bhai
for stack bottom function
int stackBottom(struct node *pt){
while(pt-> next !=NULL)
{pt= pt->next;}
return pt->data;
}
int stackBottom(struct node *top)
{
struct node *ptr = top;
struct node *q = top->next;
while (q != NULL)
{
ptr = ptr->next;
q = q->next;
};
return ptr->data;
}
int stackBottom(struct Node * top){
struct Node * p = top;
struct Node * q = top->next;
while(q != NULL){
p = p->next;
q = q->next;
}
return p->data;
}
Thankyou Sir❤️❤️
int stackBottom(struct Node* top){
struct Node *k = top;
while(k->next){
k=k->next;
}
return k->data;
}😇
Home work -->stackbottom code:int stackbottom(struct Node *head){
if(isEmpty(head)){
return -1;
}
else{
int size=0,i=1;
struct Node *p=(struct Node *)malloc(sizeof(struct Node));
p=head;
while(p!=NULL){
p=p->next;
size++;
}
while(inext;
i++;
}
return head->data;
}
}
Thanks Harry Bhaiya
Nice explanation
int stackBottom(struct Node *top)
{
struct Node *ptr = top;
for (int i = 0; (i < 3); i++)
{
ptr = ptr->next;
}
return ptr->data;
}
printf("The Bottom element of the stack is %d", stackBottom(top));
8:34
int stackBottom(struct Node * ptr)
{
for (int i=0; (ptr->next)!=NULL; i++)
{
ptr=ptr->next;
}
return ptr->data;
}
Harry bhai ek request hai.
Can you please make a tutorial on database management system as well
If your answer is yes then please reply to me. I have watched many of your tutorials
while(ptr!=NULL){
ptr=ptr->next;}
cout
Near 1M Harry Bhai!
Near 2M with in 7 months. Congrats harry bhai :)
stack bottom :
int stackbottom(node *top){
node *ptr = top;
while (ptr->next != NULL)
{
ptr = ptr->next;
}
int b = ptr->data;
return b;
}
Stack Bottom:-
int BottomStack(struct node *top)
{
struct node *ptr = top;
while (ptr->next != NULL)
{
ptr = ptr->next;
}
return ptr->data;
}
code for stackBottom--->
int stackBottom(ND* top){
ND* ptr=top;
while(ptr->next!=NULL){
ptr=ptr->next;
}
return ptr->data;
}
Solution:
int stackBottom(){
struct Node *ptr = top;
while (ptr->next != NULL)
{
ptr = ptr -> next;
}
return ptr->data;
}
stackbottom(struct node * top){
struct node *ptr=top;
while(ptr->next==NULL){
printf("element of stack botttom is %d",ptr->data);
}
}