2. Aims:
1. We want what is the data structures.
2. We want what is the stack.
3. What is the queue and type of queue.
2
3. Topic :
1. Introduction.
2. Stack Data Structure.
3. Queue Data Structure.
4. Circular Queue Data Structure.
3
4. 1. Introduction
Is a particular way of storing and organizing data in a computer so
that it can be used efficiently.
There are two major categories:
• Static Structures
• Dynamic Structures
• Each has its own set of advantages and disadvantages.
4
5. Static Data Structures vs. Dynamic Data Structures
• Static Data structure:
–Is given a fixed area of memory which it can operate within.
It is not possible to expand this fixed size in the run time. So that,
locations of each element is fixed and known by the program.
• Dynamic data structure :
Has an area where it can operate. However, this size of the area is
flexible, not fixed as it was with static data structures.
It is possible to expand or contract the area as required, by adding
or removing elements from data structure.
Example: a static array and a dynamic linked list. 5
6. 2. Stack Data Structure
Stack: A data structure in which the elements are added and
removed from one end only; a Last In First Out (LIFO) data
structure.
6
push
pop
7. A last in, first out (LIFO) abstract data type and data
structure.
Push: the push operation adds a new item to the top of the stack
insert number 5
insert number 6
7
5
6
5
7
6
5
Insert number 7
8
7
6
5
Insert number 8
9. 3. Queue Data Structure
A first in, first out (FIFO) abstract data type and data
structure.
Enqueue : We call the insert operation on a queue EnQueue.
Dequeue: And the delete operation DeQueue.
9
Enqueue
Dequeue
11. 4. Circular Queue Data Structure
“first in first out”.
– Insertion can be made only at the end (tail).
– Deletion can be made only at the front (head).
11
13. References
1. DATA STRUCTURES USING C++
SECOND EDITION : D.S. MALIK
2.البيانات هياكل مفصل الشرح
الكاتب:عبدالقادر داود ناصيف خالد.
3. Programming with 469 solved problems
Dr . Nassir H. salman
13