M1 - Intro to Data Struct. & Abstract Data Types
affects the design of both structural & functional aspects of a program
Data Structure
representation of the logical relationship existing between individual elements of data
Data Structure
binding the data, and the functions that use them
Encapsulation
•add an item •remove an item •find, retrieve, or access an item
Every Collection ADT should provide a way to:
more general branching structure, with less strict connection conditions than for a tree
Graph
Unordered lists which use a 'hash function' to insert and search
Hash tables
In this type of data structures, values of the same types of data are stored Ex: Array
Homogenous
a collection of data and associated operations for manipulating that data
Abstract Data Type
data type that separates the logical properties from the implementation details
Abstract Data Type
stores data and allow various operations on the data to access and change it.
Abstract Data Type
Separating design details from usage
Abstraction
Separating the logical properties from the implementation details
Abstraction
providing only essential information outside the world
Abstraction
a set of instruction written to carry out certain tasks & the data structure is the way of organizing the data with their logical relationship retained
Algorithm
a step by step procedure to solve a particular function
Algorithm
In this type of data structures, data values of different types are grouped and stored Ex: Structure, Classes
Non-Homogenous
derived from the primitive data structures
Non-Primitive Data Structure
emphasize on structuring of a group of homogeneous (same type) or heterogeneous (different type) data items
Non-Primitive Data Structure
more sophisticated data structures
Non-Primitive Data Structure
basic structures and directly operated upon by the machine instructions
Primitive Data Structure
Integer, Floating-point number, Character constants, string constants, pointers
Primitive Data Structure Examples
• It must be rich enough in structure to represent the relationship between data elements • The structure should be simple enough that one can effectively process the data when necessary
The choice of particular data model depends on two consideration
Data is organized in branches
Tree
True or False: To develop a program of an algorithm, we should select an appropriate data structure for that algorithm
True
True or False: Program=Algorithm + Data Structure
True
Linear List Non-Linear List
Two Types of Non-Primitive Data Structure
Array Linked-list Stack Queue Priority queue
Types of Linear List from NDS
Hash tables Tree Graph
Types of Non-Linear List from NDS
fixed-size
array
variable-size
linked-list
add anywhere, remove the highest priority
priority queue
add to back and remove from font
queue
add to top and remove from top
stack