KEMBAR78
Types of datastructures | PPTX
TYPES
OF
DATA STRUCTURES
P.Prathibha,
Lecturer
Topics
Introduction to Data structures
Types of Data structures
Data structure is
• representation of the logical relationship existing between individual elements of data.
• a specialized format for organizing and storing data in memory that considers not only the
elements stored but also their relationship to each other.
• about arranging and storing of data in such a way so that it can be accessed and used
efficiently.
• We define a data structure as a way of organizing data that specifies
1. a set of data elements, i,e,, a data object; and
2. a set of operations that are applied to this data object.
• These two sets form a mathematical construct that may be implemented using a particular
programming language.
• The data structure is independent of their implementation.
Introduction to Data Structures
The various types of data structures are:
1. Primitive and non-primitive
2. Linear and non-linear
3. Static and dynamic
4. Persistent and ephemeral
5. Sequential and direct access
TYPES OF DATA STRUCTURES
Primitive and Non-Primitive Data Structure
 Primitive Data Structures are the basic data structures that directly operate upon the
machine instructions.
 Primitive data structures define a set of primitive elements that do not involve any
other elements as its sub-parts.
For example, data structures defined for integers and characters.
 These are generally primary or built-in data types in programming languages
 They have different representations on different computers.
 Integers, Floating point numbers, Character constants, String constants and Pointers c
ome under this category.
 Non-primitive data structures are more complicated data structures and are derived f
rom primitive data structures.
 They emphasize on grouping same or different data items with relationship between
each data item.
 Arrays, Lists and Files come under this category.
 Arrays in C++ consist of a set of similar type of elements.
 Class and Structure are other examples of non-primitive data structures, which
consist of a set of elements that may be of different data types and functions to o
perate on.
 A data structure is said to be linear if its elements form a sequence or a linear list.
Example: Arrays, linked list, stack, queue.
 In a linear data structure, every data element has a unique successor and
predecessor.
 There are two basic ways of representing linear structures in memory.
 One way is to have the relationship between the elements by means of pointers
(links), called linked lists.
 The other way is using sequential organization, that is, arrays.
 In linear data structure, single level is involved. Therefore, we can traverse all the
elements in single run only.
 Linear data structures are easy to implement because computer memory is
arranged in a linear way.
Linear and Non-Linear Data Structure
 Non-linear data structure are used to represent the data containing hierarchical or
network relationship among the elements.
Examples: Trees, Graphs, Heaps etc.
 In non-linear data structures, every data element may have more than one predecessor as well as
successor.
 Elements do not form any particular linear sequence.
 In a non-linear data structure, single level is not involved. So, we can’t traverse all the elements in
single run only.
 Non-linear data structures are not easy to implement in comparison to linear data structure.
 It utilizes computer memory efficiently in comparison to a linear data structure.
contd..
 A data structure is static if it is created before program execution begins (also
called during compilation time).
 Static Data Structure means set of data, but that does not mean that we cannot ch
ange the assigned value of elements.
 Here static means the size of data type is fixed.
 Memory size allocated to 'data' is fixed.
 The variables of static data structure have user-specified names.
 An array is a static data structure
 Dynamic data structure is used for dynamic memory management.
 A data structure that is created at run-time is called dynamic data structure.
 The variables of this type are not always referenced by a user-defined name. The
se are accessed
 indirectly using their addresses through pointers.
 A linked list is a dynamic data structure when realized using dynamic memory
management and pointers.
 Non-linear data structures are generally implemented in the same way as linked
lists. Hence, trees and graphs can be implemented as dynamic data structures.
Static and Dynamic Data structure
A data structure that supports operations on the most recent version as well
as the pervious is known as persistent data structure.
 A persistent data structure is partially persistent if any version can be acces
sed but only the most recent one can be updated; it is fully persistent if any v
ersion can be both accessed and updated.
An ephemeral data structure is one that supports operations only on the mo
st recent version.
The distinction between ephemeral and persistent data structure is essential
ly the distinction between functional (also called effect free) and conventio
nal imperative (also called effect full) programming paradigms.
 The functional data structures are persistent and the imperative data struct
ures are ephemeral.
 Sequential access means that to acces the nth
element, we must access the preceeding (n-1)
data elements.
 A linked list is a sequential access data
structure.
 Direct access means that any element can be
assessed without accessing its predecessor or
successor, we can directly access the nth
element.
 An array is an example of direct access data
structure.
 Introduction to Data structures
 Types of Data structures
Summary
Types of datastructures

Types of datastructures

  • 1.
  • 2.
    Topics Introduction to Datastructures Types of Data structures
  • 3.
    Data structure is •representation of the logical relationship existing between individual elements of data. • a specialized format for organizing and storing data in memory that considers not only the elements stored but also their relationship to each other. • about arranging and storing of data in such a way so that it can be accessed and used efficiently. • We define a data structure as a way of organizing data that specifies 1. a set of data elements, i,e,, a data object; and 2. a set of operations that are applied to this data object. • These two sets form a mathematical construct that may be implemented using a particular programming language. • The data structure is independent of their implementation. Introduction to Data Structures
  • 4.
    The various typesof data structures are: 1. Primitive and non-primitive 2. Linear and non-linear 3. Static and dynamic 4. Persistent and ephemeral 5. Sequential and direct access TYPES OF DATA STRUCTURES
  • 5.
    Primitive and Non-PrimitiveData Structure  Primitive Data Structures are the basic data structures that directly operate upon the machine instructions.  Primitive data structures define a set of primitive elements that do not involve any other elements as its sub-parts. For example, data structures defined for integers and characters.  These are generally primary or built-in data types in programming languages  They have different representations on different computers.  Integers, Floating point numbers, Character constants, String constants and Pointers c ome under this category.  Non-primitive data structures are more complicated data structures and are derived f rom primitive data structures.  They emphasize on grouping same or different data items with relationship between each data item.  Arrays, Lists and Files come under this category.  Arrays in C++ consist of a set of similar type of elements.  Class and Structure are other examples of non-primitive data structures, which consist of a set of elements that may be of different data types and functions to o perate on.
  • 6.
     A datastructure is said to be linear if its elements form a sequence or a linear list. Example: Arrays, linked list, stack, queue.  In a linear data structure, every data element has a unique successor and predecessor.  There are two basic ways of representing linear structures in memory.  One way is to have the relationship between the elements by means of pointers (links), called linked lists.  The other way is using sequential organization, that is, arrays.  In linear data structure, single level is involved. Therefore, we can traverse all the elements in single run only.  Linear data structures are easy to implement because computer memory is arranged in a linear way. Linear and Non-Linear Data Structure
  • 7.
     Non-linear datastructure are used to represent the data containing hierarchical or network relationship among the elements. Examples: Trees, Graphs, Heaps etc.  In non-linear data structures, every data element may have more than one predecessor as well as successor.  Elements do not form any particular linear sequence.  In a non-linear data structure, single level is not involved. So, we can’t traverse all the elements in single run only.  Non-linear data structures are not easy to implement in comparison to linear data structure.  It utilizes computer memory efficiently in comparison to a linear data structure. contd..
  • 8.
     A datastructure is static if it is created before program execution begins (also called during compilation time).  Static Data Structure means set of data, but that does not mean that we cannot ch ange the assigned value of elements.  Here static means the size of data type is fixed.  Memory size allocated to 'data' is fixed.  The variables of static data structure have user-specified names.  An array is a static data structure  Dynamic data structure is used for dynamic memory management.  A data structure that is created at run-time is called dynamic data structure.  The variables of this type are not always referenced by a user-defined name. The se are accessed  indirectly using their addresses through pointers.  A linked list is a dynamic data structure when realized using dynamic memory management and pointers.  Non-linear data structures are generally implemented in the same way as linked lists. Hence, trees and graphs can be implemented as dynamic data structures. Static and Dynamic Data structure
  • 9.
    A data structurethat supports operations on the most recent version as well as the pervious is known as persistent data structure.  A persistent data structure is partially persistent if any version can be acces sed but only the most recent one can be updated; it is fully persistent if any v ersion can be both accessed and updated. An ephemeral data structure is one that supports operations only on the mo st recent version. The distinction between ephemeral and persistent data structure is essential ly the distinction between functional (also called effect free) and conventio nal imperative (also called effect full) programming paradigms.  The functional data structures are persistent and the imperative data struct ures are ephemeral.
  • 10.
     Sequential accessmeans that to acces the nth element, we must access the preceeding (n-1) data elements.  A linked list is a sequential access data structure.  Direct access means that any element can be assessed without accessing its predecessor or successor, we can directly access the nth element.  An array is an example of direct access data structure.
  • 11.
     Introduction toData structures  Types of Data structures Summary