SlideShare a Scribd company logo
1 of 1
What are the differences between a linked list and a stack?
Solution
A Stack is basically a linear type data structure, which means the elements are present in a linear
manner. In stack whatever is stored first it comes out last. It works in LIFO manner(Last in first
out). In stack you can’t add element in between. They are like a stack of coins, i.e. if you
want to take the last coin, then all the upper coins have to be removed one by one..As a result
what goes in last is taken out the first.The process of adding and deleting elements is slow
here.Random access s fast here.
On the other hand a Linked list is not a linear data structure. In this we can access any element or
add any element in between. There is no LIFO of LILO manner (last in last out).We can add
elements wherever we want. In Linked list we basically use two pointers , one to store the value
of the variable and other to store the address of the next node(link list single element known as
node).As the next link list address is store in the second node, there is no restriction in adding a
new link list element in between .Linked list perform very fast insertion and deletion .

More Related Content

Similar to What are the differences between a linked list and a stack-SolutionA S.docx

List Data Structure
List Data StructureList Data Structure
List Data StructureZidny Nafan
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.JAYANTAOJHA
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked listchauhankapil
 
Data Structure
Data Structure Data Structure
Data Structure Ibrahim MH
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.pptSeethaDinesh
 
Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm KristinaBorooah
 
data structures and algorithms Unit 1
data structures and algorithms Unit 1data structures and algorithms Unit 1
data structures and algorithms Unit 1infanciaj
 
Linked list and its operations - Traversal
Linked list and its operations - TraversalLinked list and its operations - Traversal
Linked list and its operations - Traversalkasthurimukila
 
Data structures and algorithms lab6
Data structures and algorithms lab6Data structures and algorithms lab6
Data structures and algorithms lab6Bianca Teşilă
 
Ppt on Linked list,stack,queue
Ppt on Linked list,stack,queuePpt on Linked list,stack,queue
Ppt on Linked list,stack,queueSrajan Shukla
 
What is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdfWhat is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdfbhim1213
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)swajahatr
 

Similar to What are the differences between a linked list and a stack-SolutionA S.docx (20)

List data structure
List data structure List data structure
List data structure
 
List Data Structure
List Data StructureList Data Structure
List Data Structure
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
Data Structure
Data Structure Data Structure
Data Structure
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
Linked list
Linked listLinked list
Linked list
 
Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm
 
Linked lists
Linked listsLinked lists
Linked lists
 
data structures and algorithms Unit 1
data structures and algorithms Unit 1data structures and algorithms Unit 1
data structures and algorithms Unit 1
 
Linked list and its operations - Traversal
Linked list and its operations - TraversalLinked list and its operations - Traversal
Linked list and its operations - Traversal
 
Link list assi
Link list assiLink list assi
Link list assi
 
Linked lists
Linked listsLinked lists
Linked lists
 
Doubly Link List
Doubly Link ListDoubly Link List
Doubly Link List
 
Data structures and algorithms lab6
Data structures and algorithms lab6Data structures and algorithms lab6
Data structures and algorithms lab6
 
Ppt on Linked list,stack,queue
Ppt on Linked list,stack,queuePpt on Linked list,stack,queue
Ppt on Linked list,stack,queue
 
What is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdfWhat is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdf
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 
2- link-list.ppt
2- link-list.ppt2- link-list.ppt
2- link-list.ppt
 
Link list
Link listLink list
Link list
 

More from loisj1

What are the three reasons that the environment matters- Which of thos.docx
What are the three reasons that the environment matters- Which of thos.docxWhat are the three reasons that the environment matters- Which of thos.docx
What are the three reasons that the environment matters- Which of thos.docxloisj1
 
What are the software security activities in the life cycle-SolutionTh.docx
What are the software security activities in the life cycle-SolutionTh.docxWhat are the software security activities in the life cycle-SolutionTh.docx
What are the software security activities in the life cycle-SolutionTh.docxloisj1
 
What are the ps command line options to view information about threads.docx
What are the ps command line options to view information about threads.docxWhat are the ps command line options to view information about threads.docx
What are the ps command line options to view information about threads.docxloisj1
 
What are the steps a company cant take to protext itself against the s.docx
What are the steps a company cant take to protext itself against the s.docxWhat are the steps a company cant take to protext itself against the s.docx
What are the steps a company cant take to protext itself against the s.docxloisj1
 
What are the risks common to financial institutions- liquidity- exchan.docx
What are the risks common to financial institutions- liquidity- exchan.docxWhat are the risks common to financial institutions- liquidity- exchan.docx
What are the risks common to financial institutions- liquidity- exchan.docxloisj1
 
what are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docx
what are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docxwhat are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docx
what are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docxloisj1
 
What are the primary keys of the following table- Explain why the foll.docx
What are the primary keys of the following table- Explain why the foll.docxWhat are the primary keys of the following table- Explain why the foll.docx
What are the primary keys of the following table- Explain why the foll.docxloisj1
 
What are the major differences between capitalism- communism- and soci.docx
What are the major differences between capitalism- communism- and soci.docxWhat are the major differences between capitalism- communism- and soci.docx
What are the major differences between capitalism- communism- and soci.docxloisj1
 
What are the issues involved in measurement in organizational developm.docx
What are the issues involved in measurement in organizational developm.docxWhat are the issues involved in measurement in organizational developm.docx
What are the issues involved in measurement in organizational developm.docxloisj1
 
What are the key differences between Windows- Apple- and Linux-Solutio.docx
What are the key differences between Windows- Apple- and Linux-Solutio.docxWhat are the key differences between Windows- Apple- and Linux-Solutio.docx
What are the key differences between Windows- Apple- and Linux-Solutio.docxloisj1
 
What are the implications of unstructured data to database design- Sup.docx
What are the implications of unstructured data to database design- Sup.docxWhat are the implications of unstructured data to database design- Sup.docx
What are the implications of unstructured data to database design- Sup.docxloisj1
 
What are the income levels and infrastructure development of Mobius SL.docx
What are the income levels and infrastructure development of Mobius SL.docxWhat are the income levels and infrastructure development of Mobius SL.docx
What are the income levels and infrastructure development of Mobius SL.docxloisj1
 
What are the four stages of John Dewey SolutionFor Dewey- learning wa.docx
What are the four stages of John Dewey  SolutionFor Dewey- learning wa.docxWhat are the four stages of John Dewey  SolutionFor Dewey- learning wa.docx
What are the four stages of John Dewey SolutionFor Dewey- learning wa.docxloisj1
 
What are the equilibrium concentrations- And how do you solve it- What.docx
What are the equilibrium concentrations- And how do you solve it- What.docxWhat are the equilibrium concentrations- And how do you solve it- What.docx
What are the equilibrium concentrations- And how do you solve it- What.docxloisj1
 
What are the essential outcomes of secure system retirement- Justify y.docx
What are the essential outcomes of secure system retirement- Justify y.docxWhat are the essential outcomes of secure system retirement- Justify y.docx
What are the essential outcomes of secure system retirement- Justify y.docxloisj1
 
What are the Disadvantages of IFRS (International Financial Reporting.docx
What are the Disadvantages of IFRS (International Financial Reporting.docxWhat are the Disadvantages of IFRS (International Financial Reporting.docx
What are the Disadvantages of IFRS (International Financial Reporting.docxloisj1
 
what are the con-'s of virtual reality in specificSolutionDisadvantage.docx
what are the con-'s of virtual reality in specificSolutionDisadvantage.docxwhat are the con-'s of virtual reality in specificSolutionDisadvantage.docx
what are the con-'s of virtual reality in specificSolutionDisadvantage.docxloisj1
 
What are the advantages of IPv6 over IPv4- Why is security often consi.docx
What are the advantages of IPv6 over IPv4- Why is security often consi.docxWhat are the advantages of IPv6 over IPv4- Why is security often consi.docx
What are the advantages of IPv6 over IPv4- Why is security often consi.docxloisj1
 
What are some tax consequences related to a qualified pension plan- (P.docx
What are some tax consequences related to a qualified pension plan- (P.docxWhat are some tax consequences related to a qualified pension plan- (P.docx
What are some tax consequences related to a qualified pension plan- (P.docxloisj1
 
What are some primary reasons why an embedded system developer would u.docx
What are some primary reasons why an embedded system developer would u.docxWhat are some primary reasons why an embedded system developer would u.docx
What are some primary reasons why an embedded system developer would u.docxloisj1
 

More from loisj1 (20)

What are the three reasons that the environment matters- Which of thos.docx
What are the three reasons that the environment matters- Which of thos.docxWhat are the three reasons that the environment matters- Which of thos.docx
What are the three reasons that the environment matters- Which of thos.docx
 
What are the software security activities in the life cycle-SolutionTh.docx
What are the software security activities in the life cycle-SolutionTh.docxWhat are the software security activities in the life cycle-SolutionTh.docx
What are the software security activities in the life cycle-SolutionTh.docx
 
What are the ps command line options to view information about threads.docx
What are the ps command line options to view information about threads.docxWhat are the ps command line options to view information about threads.docx
What are the ps command line options to view information about threads.docx
 
What are the steps a company cant take to protext itself against the s.docx
What are the steps a company cant take to protext itself against the s.docxWhat are the steps a company cant take to protext itself against the s.docx
What are the steps a company cant take to protext itself against the s.docx
 
What are the risks common to financial institutions- liquidity- exchan.docx
What are the risks common to financial institutions- liquidity- exchan.docxWhat are the risks common to financial institutions- liquidity- exchan.docx
What are the risks common to financial institutions- liquidity- exchan.docx
 
what are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docx
what are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docxwhat are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docx
what are the Pro-'s and Con-'s of virtual reality -SolutionPro-'s of v.docx
 
What are the primary keys of the following table- Explain why the foll.docx
What are the primary keys of the following table- Explain why the foll.docxWhat are the primary keys of the following table- Explain why the foll.docx
What are the primary keys of the following table- Explain why the foll.docx
 
What are the major differences between capitalism- communism- and soci.docx
What are the major differences between capitalism- communism- and soci.docxWhat are the major differences between capitalism- communism- and soci.docx
What are the major differences between capitalism- communism- and soci.docx
 
What are the issues involved in measurement in organizational developm.docx
What are the issues involved in measurement in organizational developm.docxWhat are the issues involved in measurement in organizational developm.docx
What are the issues involved in measurement in organizational developm.docx
 
What are the key differences between Windows- Apple- and Linux-Solutio.docx
What are the key differences between Windows- Apple- and Linux-Solutio.docxWhat are the key differences between Windows- Apple- and Linux-Solutio.docx
What are the key differences between Windows- Apple- and Linux-Solutio.docx
 
What are the implications of unstructured data to database design- Sup.docx
What are the implications of unstructured data to database design- Sup.docxWhat are the implications of unstructured data to database design- Sup.docx
What are the implications of unstructured data to database design- Sup.docx
 
What are the income levels and infrastructure development of Mobius SL.docx
What are the income levels and infrastructure development of Mobius SL.docxWhat are the income levels and infrastructure development of Mobius SL.docx
What are the income levels and infrastructure development of Mobius SL.docx
 
What are the four stages of John Dewey SolutionFor Dewey- learning wa.docx
What are the four stages of John Dewey  SolutionFor Dewey- learning wa.docxWhat are the four stages of John Dewey  SolutionFor Dewey- learning wa.docx
What are the four stages of John Dewey SolutionFor Dewey- learning wa.docx
 
What are the equilibrium concentrations- And how do you solve it- What.docx
What are the equilibrium concentrations- And how do you solve it- What.docxWhat are the equilibrium concentrations- And how do you solve it- What.docx
What are the equilibrium concentrations- And how do you solve it- What.docx
 
What are the essential outcomes of secure system retirement- Justify y.docx
What are the essential outcomes of secure system retirement- Justify y.docxWhat are the essential outcomes of secure system retirement- Justify y.docx
What are the essential outcomes of secure system retirement- Justify y.docx
 
What are the Disadvantages of IFRS (International Financial Reporting.docx
What are the Disadvantages of IFRS (International Financial Reporting.docxWhat are the Disadvantages of IFRS (International Financial Reporting.docx
What are the Disadvantages of IFRS (International Financial Reporting.docx
 
what are the con-'s of virtual reality in specificSolutionDisadvantage.docx
what are the con-'s of virtual reality in specificSolutionDisadvantage.docxwhat are the con-'s of virtual reality in specificSolutionDisadvantage.docx
what are the con-'s of virtual reality in specificSolutionDisadvantage.docx
 
What are the advantages of IPv6 over IPv4- Why is security often consi.docx
What are the advantages of IPv6 over IPv4- Why is security often consi.docxWhat are the advantages of IPv6 over IPv4- Why is security often consi.docx
What are the advantages of IPv6 over IPv4- Why is security often consi.docx
 
What are some tax consequences related to a qualified pension plan- (P.docx
What are some tax consequences related to a qualified pension plan- (P.docxWhat are some tax consequences related to a qualified pension plan- (P.docx
What are some tax consequences related to a qualified pension plan- (P.docx
 
What are some primary reasons why an embedded system developer would u.docx
What are some primary reasons why an embedded system developer would u.docxWhat are some primary reasons why an embedded system developer would u.docx
What are some primary reasons why an embedded system developer would u.docx
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 

What are the differences between a linked list and a stack-SolutionA S.docx

  • 1. What are the differences between a linked list and a stack? Solution A Stack is basically a linear type data structure, which means the elements are present in a linear manner. In stack whatever is stored first it comes out last. It works in LIFO manner(Last in first out). In stack you can’t add element in between. They are like a stack of coins, i.e. if you want to take the last coin, then all the upper coins have to be removed one by one..As a result what goes in last is taken out the first.The process of adding and deleting elements is slow here.Random access s fast here. On the other hand a Linked list is not a linear data structure. In this we can access any element or add any element in between. There is no LIFO of LILO manner (last in last out).We can add elements wherever we want. In Linked list we basically use two pointers , one to store the value of the variable and other to store the address of the next node(link list single element known as node).As the next link list address is store in the second node, there is no restriction in adding a new link list element in between .Linked list perform very fast insertion and deletion .