Fundamental Data Structures: Stacks, Queues, and Operations Explained

data types n.w
1 / 9
Embed
Share

Explore the concepts of stacks and queues in data structures through detailed explanations and visuals. Understand the principles of Last-In-First-Out (LIFO) and First-In-First-Out (FIFO) along with operations like push, pop, read, and write. Learn how these data structures are essential in programming and problem-solving. Enhance your understanding with examples provided by Ali Akbar Mohammadi.

  • Data Structures
  • Stacks
  • Queues
  • LIFO
  • FIFO

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Data Types

  2. LIFO Ali Akbar Mohammadi 2

  3. Stacks A stack is a collection of objects that are inserted and removed according to the last-in, first-out (LIFO) principle. A user may insert objects into a stack at any time, but may only access or remove the most recently inserted object that remains (at the so-called top of the stack) Ali Akbar Mohammadi 3

  4. Practice First Q Last Method Return Value [] Ali Akbar Mohammadi 4

  5. Functions for stack: push() : insert a data into stack pop(): remove a data from stack show(): show the last data that inserted into stack without removing it. Ali Akbar Mohammadi 5

  6. FIFO Ali Akbar Mohammadi 6

  7. Queues Another fundamental data structure is the queue. It is a close cousin of the stack, but a queue is a collection of objects that are inserted and removed according to the first-in, first-out (FIFO) principle. That is, elements can be inserted at any time, but only the element that has been in the queue the longest can be next removed. Ali Akbar Mohammadi 7

  8. Functions for queue: Read (): Write(): Ali Akbar Mohammadi 8

  9. Practice First Q Last Method Return Value Ali Akbar Mohammadi 9

Related


More Related Content