SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
Arrays, Linked List, Stack and Queues


What are array, linked list, stack and queues? What is the concept behind
stack and queues? What is the requirement of stack and queues. If we have
arrays for the concept of list then how come we require linked list. How
linked list is more advantageous than array?


These are some of the questions come into a students mind when the concept
of stack and linked list is introduced to them. It’s really a big deal to make
this concept clear to each and every student of the class. Ask a student and
they will say “The most difficult chapter is array, linked list, stack and
queues, I could not understand it.”


I tried a lot to make this concept clear to the students using power point
slides, diagrams and animations present on the Internet but then only I was
not satisfied. As the diagrams, the animation, power point slides were
helping to understand one or the other concept related to Arrays, linked list,
stack and queues at a time but not a clear picture of overall basic concept of
Arrays, linked list, stack and queues. Some of the questions asked by the
students were remain unanswered with the help of power point or other
technological tool. I was searching for better way to make students
understand about the concept.


In one of my class on linked list, it just struck to my mind and I took
example of students sitting in a row in the class. Just that !!!!!!!!!!!

To my surprise, all the questions asked by the students got answers using
this example. In this batch of XII class, now nobody says that we don’t
know the concept of arrays, linked list, stack and queues. They are satisfied
and moreover I am satisfied this way of teaching arrays, linked list stack and
queues.
Arrays and linked list are data structures used to represent list in C++
programming.

Arrays allocate contiguous memory but linked list has non contiguous
memory allocation
To make this concept clear, I ask a whole row of the students in the class to
stand up and showed the students that this is the concept of array where
every item has to be adjacent to each other at one place that is contiguous
memory allocation

Then I ask some of the students from the class to stand up haphazardly from
different rows and told them to call the name of the student given to them by
me. Like ‘A’ student from row1 will call the name of ‘B’ student in row2
then B student will call the name of ‘C’ student in row4 and so on. Then I
told them this is the concept of linked list where items of the list don’t need
to be at one place and there are join with pointers where pointers have the
address of next item in the linked list as here each student has the name of
next student they have to call.

                ROW1    ROW2     ROW3      ROW4

                                             *
                                             *
                                             *
                                             *
                                             *


                ROW1    ROW2     ROW3      ROW4



                                             C
                 A


                          B
If array is there than what is the need of linked list?
Array is static in nature and linked list is dynamic in nature.
To make this concept clear to them, again I make students of a row1 to stand
up and ask a student of row2 to come and sit in row1 which is fully filled.
He was not able to sit as there was no space. This is the concept of array if
there is a space for 5 items then we can’t increase the space as per our
requirement at run time. That is array is static in nature
Then I again make students stand haphazardly and told them the names of
next student. I ask that student from row2 to now sit on any other empty seat
in the class. Those student who were standing, I told to the last student (who
has not called any other student) to call the name of the student who has just
be seated from row2 to any other empty seat. This is the concept of linked
list where new item got the space as per the requirement and linked to the
linked list by pointers. Linked list is dynamic in nature.


               ROW1     ROW2     ROW3      ROW4

                 *      &

                 *      &

                 *      &

                 *      &

                 *
     &    No Space


                ROW1    ROW2     ROW3      ROW4



                                             C
                 A


                         B         &
      & got the space
Stack has the concept of Last in first out (LIFO)
Stack is a concept where the item last entered is deleted first.
To make this concept of stack clear I told the student to sit in a row one by
one. Then ask the last student who sat in a row to stand up and come out of
the row. Then again ask the second last student to come out. This is the
concept of Last in First out in a stack. Stack can be implemented both using
arrays and linked list.

             ROW1     ROW2    ROW3       ROW4


               *
               *
               *
    *
    *
Deleted




               ROW1    ROW2     ROW3      ROW4



                                            C
                A


                         B           &



            & C Deleted
Queue has the concept of First in first out (FIFO)
Queue is a concept where the item first entered is deleted first.
To make this concept clear I told the students to sit in a row one by one. I
ask first student of the row to stand up and come out. Then again I ask next
first student of the row to stand up and come out. This is the concept of First
in first out in a queue. Queue can be implemented both using arrays and
linked list




               ROW1     ROW2     ROW3      ROW4




                  *
*                 *
*                 *
Deleted




                ROW1    ROW2     ROW3      ROW4



                                             C




                                   &
      A Deleted
      B Deleted
                                                           Submitted by :
                                                               Ms. Isha Bhatia,
                                                            PGT Computer Sc.
                                                   Kendriya Vidyalaya Pitampura

Mais conteúdo relacionado

Último

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 

Último (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
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
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 

Destaque

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Understanding Arrays, Linked Lists, Stacks and Queues with Real-World Examples

  • 1. Arrays, Linked List, Stack and Queues What are array, linked list, stack and queues? What is the concept behind stack and queues? What is the requirement of stack and queues. If we have arrays for the concept of list then how come we require linked list. How linked list is more advantageous than array? These are some of the questions come into a students mind when the concept of stack and linked list is introduced to them. It’s really a big deal to make this concept clear to each and every student of the class. Ask a student and they will say “The most difficult chapter is array, linked list, stack and queues, I could not understand it.” I tried a lot to make this concept clear to the students using power point slides, diagrams and animations present on the Internet but then only I was not satisfied. As the diagrams, the animation, power point slides were helping to understand one or the other concept related to Arrays, linked list, stack and queues at a time but not a clear picture of overall basic concept of Arrays, linked list, stack and queues. Some of the questions asked by the students were remain unanswered with the help of power point or other technological tool. I was searching for better way to make students understand about the concept. In one of my class on linked list, it just struck to my mind and I took example of students sitting in a row in the class. Just that !!!!!!!!!!! To my surprise, all the questions asked by the students got answers using this example. In this batch of XII class, now nobody says that we don’t know the concept of arrays, linked list, stack and queues. They are satisfied and moreover I am satisfied this way of teaching arrays, linked list stack and queues.
  • 2. Arrays and linked list are data structures used to represent list in C++ programming. Arrays allocate contiguous memory but linked list has non contiguous memory allocation To make this concept clear, I ask a whole row of the students in the class to stand up and showed the students that this is the concept of array where every item has to be adjacent to each other at one place that is contiguous memory allocation Then I ask some of the students from the class to stand up haphazardly from different rows and told them to call the name of the student given to them by me. Like ‘A’ student from row1 will call the name of ‘B’ student in row2 then B student will call the name of ‘C’ student in row4 and so on. Then I told them this is the concept of linked list where items of the list don’t need to be at one place and there are join with pointers where pointers have the address of next item in the linked list as here each student has the name of next student they have to call. ROW1 ROW2 ROW3 ROW4 * * * * * ROW1 ROW2 ROW3 ROW4 C A B
  • 3. If array is there than what is the need of linked list? Array is static in nature and linked list is dynamic in nature. To make this concept clear to them, again I make students of a row1 to stand up and ask a student of row2 to come and sit in row1 which is fully filled. He was not able to sit as there was no space. This is the concept of array if there is a space for 5 items then we can’t increase the space as per our requirement at run time. That is array is static in nature Then I again make students stand haphazardly and told them the names of next student. I ask that student from row2 to now sit on any other empty seat in the class. Those student who were standing, I told to the last student (who has not called any other student) to call the name of the student who has just be seated from row2 to any other empty seat. This is the concept of linked list where new item got the space as per the requirement and linked to the linked list by pointers. Linked list is dynamic in nature. ROW1 ROW2 ROW3 ROW4 * & * & * & * & * & No Space ROW1 ROW2 ROW3 ROW4 C A B & & got the space
  • 4. Stack has the concept of Last in first out (LIFO) Stack is a concept where the item last entered is deleted first. To make this concept of stack clear I told the student to sit in a row one by one. Then ask the last student who sat in a row to stand up and come out of the row. Then again ask the second last student to come out. This is the concept of Last in First out in a stack. Stack can be implemented both using arrays and linked list. ROW1 ROW2 ROW3 ROW4 * * * * * Deleted ROW1 ROW2 ROW3 ROW4 C A B & & C Deleted
  • 5. Queue has the concept of First in first out (FIFO) Queue is a concept where the item first entered is deleted first. To make this concept clear I told the students to sit in a row one by one. I ask first student of the row to stand up and come out. Then again I ask next first student of the row to stand up and come out. This is the concept of First in first out in a queue. Queue can be implemented both using arrays and linked list ROW1 ROW2 ROW3 ROW4 * * * * * Deleted ROW1 ROW2 ROW3 ROW4 C & A Deleted B Deleted Submitted by : Ms. Isha Bhatia, PGT Computer Sc. Kendriya Vidyalaya Pitampura