SlideShare a Scribd company logo
initially top=0,
if top reaches the size then stack is overflow,
else push the element at top of the stack and
increament the value top by 1
if (top == size)
return false; // ** overflow error **
else
{
data[top] = newNode.deepCopy();
top = top + 1;
return true; // push operation successful
}
Solution
initially top=0,
if top reaches the size then stack is overflow,
else push the element at top of the stack and
increament the value top by 1
if (top == size)
return false; // ** overflow error **
else
{
data[top] = newNode.deepCopy();
top = top + 1;
return true; // push operation successful
}

More Related Content

More from premsrivastva8

SO32- So.pdf
                     SO32-                                      So.pdf                     SO32-                                      So.pdf
SO32- So.pdf
premsrivastva8
 
F2 and O2 are both diatomic molecules with no dip.pdf
                     F2 and O2 are both diatomic molecules with no dip.pdf                     F2 and O2 are both diatomic molecules with no dip.pdf
F2 and O2 are both diatomic molecules with no dip.pdf
premsrivastva8
 
ideal gas law= PV=nRT Daltons law of partial pr.pdf
                     ideal gas law= PV=nRT Daltons law of partial pr.pdf                     ideal gas law= PV=nRT Daltons law of partial pr.pdf
ideal gas law= PV=nRT Daltons law of partial pr.pdf
premsrivastva8
 
Hey I couldnt click on it so I will explain it .pdf
                     Hey I couldnt click on it so I will explain it .pdf                     Hey I couldnt click on it so I will explain it .pdf
Hey I couldnt click on it so I will explain it .pdf
premsrivastva8
 
H attached to N can form H bond with oxygen of w.pdf
                     H attached to N  can form H bond with oxygen of w.pdf                     H attached to N  can form H bond with oxygen of w.pdf
H attached to N can form H bond with oxygen of w.pdf
premsrivastva8
 
First, assign oxidation numbers.+1 +6 -2     +2                +1 .pdf
First, assign oxidation numbers.+1 +6 -2     +2                +1 .pdfFirst, assign oxidation numbers.+1 +6 -2     +2                +1 .pdf
First, assign oxidation numbers.+1 +6 -2     +2                +1 .pdf
premsrivastva8
 
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfCountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
premsrivastva8
 
chemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdf
chemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdfchemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdf
chemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdf
premsrivastva8
 
B. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdf
B. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdfB. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdf
B. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdf
premsrivastva8
 
2nd option is correctas tha no of elements in LHS set equal to tha.pdf
2nd option is correctas tha no of elements in LHS set equal to tha.pdf2nd option is correctas tha no of elements in LHS set equal to tha.pdf
2nd option is correctas tha no of elements in LHS set equal to tha.pdf
premsrivastva8
 
3. Compound XII only. other compounds dont hav.pdf
                     3. Compound XII only.  other compounds dont hav.pdf                     3. Compound XII only.  other compounds dont hav.pdf
3. Compound XII only. other compounds dont hav.pdf
premsrivastva8
 

More from premsrivastva8 (11)

SO32- So.pdf
                     SO32-                                      So.pdf                     SO32-                                      So.pdf
SO32- So.pdf
 
F2 and O2 are both diatomic molecules with no dip.pdf
                     F2 and O2 are both diatomic molecules with no dip.pdf                     F2 and O2 are both diatomic molecules with no dip.pdf
F2 and O2 are both diatomic molecules with no dip.pdf
 
ideal gas law= PV=nRT Daltons law of partial pr.pdf
                     ideal gas law= PV=nRT Daltons law of partial pr.pdf                     ideal gas law= PV=nRT Daltons law of partial pr.pdf
ideal gas law= PV=nRT Daltons law of partial pr.pdf
 
Hey I couldnt click on it so I will explain it .pdf
                     Hey I couldnt click on it so I will explain it .pdf                     Hey I couldnt click on it so I will explain it .pdf
Hey I couldnt click on it so I will explain it .pdf
 
H attached to N can form H bond with oxygen of w.pdf
                     H attached to N  can form H bond with oxygen of w.pdf                     H attached to N  can form H bond with oxygen of w.pdf
H attached to N can form H bond with oxygen of w.pdf
 
First, assign oxidation numbers.+1 +6 -2     +2                +1 .pdf
First, assign oxidation numbers.+1 +6 -2     +2                +1 .pdfFirst, assign oxidation numbers.+1 +6 -2     +2                +1 .pdf
First, assign oxidation numbers.+1 +6 -2     +2                +1 .pdf
 
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfCountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
 
chemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdf
chemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdfchemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdf
chemical equation 2HF(aq) + Ca(OH)2(aq) = CaF2(s) + 2H2O(l) ion.pdf
 
B. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdf
B. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdfB. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdf
B. Router(config-if)#ip address dhcpThe ip address dhcp command mu.pdf
 
2nd option is correctas tha no of elements in LHS set equal to tha.pdf
2nd option is correctas tha no of elements in LHS set equal to tha.pdf2nd option is correctas tha no of elements in LHS set equal to tha.pdf
2nd option is correctas tha no of elements in LHS set equal to tha.pdf
 
3. Compound XII only. other compounds dont hav.pdf
                     3. Compound XII only.  other compounds dont hav.pdf                     3. Compound XII only.  other compounds dont hav.pdf
3. Compound XII only. other compounds dont hav.pdf
 

Recently uploaded

Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
Celine George
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 

Recently uploaded (20)

Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 

initially top=0, if top reaches the size then stack is overflow.pdf

  • 1. initially top=0, if top reaches the size then stack is overflow, else push the element at top of the stack and increament the value top by 1 if (top == size) return false; // ** overflow error ** else { data[top] = newNode.deepCopy(); top = top + 1; return true; // push operation successful } Solution initially top=0, if top reaches the size then stack is overflow, else push the element at top of the stack and increament the value top by 1 if (top == size) return false; // ** overflow error ** else { data[top] = newNode.deepCopy(); top = top + 1; return true; // push operation successful }