SlideShare una empresa de Scribd logo
1 de 5
Descargar para leer sin conexión
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

Más contenido relacionado

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

Destacado

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
ThinkNow
 
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
Kurio // The Social Media Age(ncy)
 

Destacado (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
 

Btpc 08 papers isha-arrays

  • 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