INTRODUCTION TO DATA
STRUCTURE
Zaheer Abbas
DATA STRUCTURE
Data
Structure
Non-
Linear
Linear
Data structure is a
storage that is used to
store and organize
data.
Linear Data Structures
Array Data Structure
Stack Data Structure
Queue Data Structure
Linked List Data
Structure
Dynamic
Static
Non-Linear Data Structures
Graph Data
Structure
Tree Data
Structure
Array
Array
 Array: An ordered collection of values with two
distinguishing characters:
 Ordered and fixed length
 Homogeneous. Every value in the array must be of the same
type
 The individual values in an array are called elements.
 The number of elements is called the length of the
array
Stack
 It is an ordered group of homogeneous items of elements.
 Elements are added to and removed from the top of the
stack (the most recently added items are at the top of the
stack).
 The last element to be added is the first to be removed
(LIFO: Last In, First Out).
Stack Specification
 Definitions: (provided by the user)
 MAX_ITEMS: Max number of items that might be
on the stack
 ItemType: Data type of the items on the stack
 Operations
 MakeEmpty
 Boolean IsEmpty
 Boolean IsFull
 Push (ItemType newItem)
 Pop (ItemType& item) (or pop and top)
Queue
 It is an ordered group of homogeneous items
of elements.
 Queues have two ends:
 Elements are added at one end.
 Elements are removed from the other end.
 The element added first is also removed first
(FIFO: First In, First Out).
queue
elements
enter
no changes of order
elements
exit
2
3
4 1
tail head
Queue Specification
 Definitions: (provided by the user)
 MAX_ITEMS: Max number of items that might be
on the queue
 ItemType: Data type of the items on the queue
• Operations
– MakeEmpty
– Boolean IsEmpty
– Boolean IsFull
– Enqueue (ItemType newItem)
– Dequeue (ItemType & item) (serve and retrieve)
Linked List
A linked list is a linear data structure, in which the
elements are not stored at contiguous memory
locations. The elements in a linked list are linked
using pointers
Any question?

Lect-1.pptx

  • 1.
  • 2.
    DATA STRUCTURE Data Structure Non- Linear Linear Data structureis a storage that is used to store and organize data.
  • 3.
    Linear Data Structures ArrayData Structure Stack Data Structure Queue Data Structure Linked List Data Structure Dynamic Static
  • 4.
    Non-Linear Data Structures GraphData Structure Tree Data Structure
  • 5.
  • 6.
    Array  Array: Anordered collection of values with two distinguishing characters:  Ordered and fixed length  Homogeneous. Every value in the array must be of the same type  The individual values in an array are called elements.  The number of elements is called the length of the array
  • 7.
    Stack  It isan ordered group of homogeneous items of elements.  Elements are added to and removed from the top of the stack (the most recently added items are at the top of the stack).  The last element to be added is the first to be removed (LIFO: Last In, First Out).
  • 8.
    Stack Specification  Definitions:(provided by the user)  MAX_ITEMS: Max number of items that might be on the stack  ItemType: Data type of the items on the stack  Operations  MakeEmpty  Boolean IsEmpty  Boolean IsFull  Push (ItemType newItem)  Pop (ItemType& item) (or pop and top)
  • 9.
    Queue  It isan ordered group of homogeneous items of elements.  Queues have two ends:  Elements are added at one end.  Elements are removed from the other end.  The element added first is also removed first (FIFO: First In, First Out). queue elements enter no changes of order elements exit 2 3 4 1 tail head
  • 10.
    Queue Specification  Definitions:(provided by the user)  MAX_ITEMS: Max number of items that might be on the queue  ItemType: Data type of the items on the queue • Operations – MakeEmpty – Boolean IsEmpty – Boolean IsFull – Enqueue (ItemType newItem) – Dequeue (ItemType & item) (serve and retrieve)
  • 11.
    Linked List A linkedlist is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers
  • 12.

Editor's Notes

  • #6  Explain that not all projects require funding…. Distinction between project and process!! Use pinnacle example….
  • #7  Explain that not all projects require funding…. Distinction between project and process!! Use pinnacle example….