Ms. K.Nanthini Assistant Professor(SRG), Kongu engineering college, Erode, Tamilnadu, Introduction on Data Structures Data Types & Application of Data Structures
Data Types
(Cont.,) Data types are means to identify the type of data and associated operations of handling it. • Primitive or Primary or build-in data types • Derived or Composite or Secondary data types – derived from one or more primitive data types – Array, Function, Pointer, reference • User defined data types- Structure, Union, Enumeration, typedef, class - The data types that are defined by the user are called the derived datatype or user-defined derived data type.
Abstract Data Types • Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations. • The definition of ADT only mentions what operations are to be performed but not how these operations will be implemented. Example: Stack, Queue, List etc.,
(Contd.,) • some operations of those mentioned ADT − • Stack − • isFull(), This is used to check whether stack is full or not • isEmpry(), This is used to check whether stack is empty or not • push(x), This is used to push x into the stack • pop(), This is used to delete one element from top of the stack • peek(), This is used to get the top most element of the stack • size(), this function is used to get number of elements present into the stack • Queue − • isFull(), This is used to check whether queue is full or not • isEmpry(), This is used to check whether queue is empty or not • insert(x), This is used to add x into the queue at the rear end • delete(), This is used to delete one element from the front end of the queue • size(), this function is used to get number of elements present into the queue
(Contd.,) • List − • size(), this function is used to get number of elements present into the list • insert(x), this function is used to insert one element into the list • remove(x), this function is used to remove given element from the list • get(i), this function is used to get element at position i • replace(x, y), this function is used to replace x with y value
Types of Data Structure
(Cont.,) Primitive Data Structures are the basic data structures that directly operate upon the machine instructions. Non-primitive data structures are more complicated data structures and are derived from primitive data structures.
Application of Data Structures • Some Applications of a Arrays are: Arrangement of leader-board of a game can be done simply through arrays to store the score and arrange them in descending order to clearly make out the rank of each player in the game. A simple question Paper is an array of numbered questions with each of them assigned to some marks. 2D arrays, commonly known as, matrix, are used in image processing. etc.,
(Cont.,) • Some applications of a Stack are: Converting infix to postfix expressions. Undo operation is also carried out through stacks. Syntaxes in languages are parsed using stacks. It is used in many virtual machines like JVM. etc., • Queue: Operating System uses queue for job scheduling. To handle congestion in networking queue can be used. Data packets in communication are arranged in queue format. etc.,
(Cont..,) • Some applications of a linked list are: Images are linked with each other. So, an image viewer software uses a linked list to view the previous and the next images using the previous and next buttons. Web pages can be accessed using the previous and the next URL links which are linked using linked list. The music players also use the same technique to switch between music. To keep the track of turns in a multi player game, a circular linked list is used. etc.,
(Cont.,) • Some applications of a graph are: Facebook’s Graph API uses the structure of Graphs. Google’s Knowledge Graph also has to do something with Graph. Dijkstra algorithm or the shortest path first algorithm also uses graph structure to finding the smallest path between the nodes of the graph. GPS navigation system also uses shortest path APIs.
(cont.,) • Some applications of the trees are: Decision-based algorithm is used in machine learning which works upon the algorithm of tree. Databases also uses tree data structures for indexing. Domain Name Server(DNS) also uses tree structures.etc.,

Introduction on Data Structures

  • 1.
    Ms. K.Nanthini Assistant Professor(SRG), Konguengineering college, Erode, Tamilnadu, Introduction on Data Structures Data Types & Application of Data Structures
  • 2.
  • 3.
    (Cont.,) Data types aremeans to identify the type of data and associated operations of handling it. • Primitive or Primary or build-in data types • Derived or Composite or Secondary data types – derived from one or more primitive data types – Array, Function, Pointer, reference • User defined data types- Structure, Union, Enumeration, typedef, class - The data types that are defined by the user are called the derived datatype or user-defined derived data type.
  • 4.
    Abstract Data Types •Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations. • The definition of ADT only mentions what operations are to be performed but not how these operations will be implemented. Example: Stack, Queue, List etc.,
  • 5.
    (Contd.,) • some operationsof those mentioned ADT − • Stack − • isFull(), This is used to check whether stack is full or not • isEmpry(), This is used to check whether stack is empty or not • push(x), This is used to push x into the stack • pop(), This is used to delete one element from top of the stack • peek(), This is used to get the top most element of the stack • size(), this function is used to get number of elements present into the stack • Queue − • isFull(), This is used to check whether queue is full or not • isEmpry(), This is used to check whether queue is empty or not • insert(x), This is used to add x into the queue at the rear end • delete(), This is used to delete one element from the front end of the queue • size(), this function is used to get number of elements present into the queue
  • 6.
    (Contd.,) • List − •size(), this function is used to get number of elements present into the list • insert(x), this function is used to insert one element into the list • remove(x), this function is used to remove given element from the list • get(i), this function is used to get element at position i • replace(x, y), this function is used to replace x with y value
  • 7.
    Types of DataStructure
  • 8.
    (Cont.,) Primitive Data Structuresare the basic data structures that directly operate upon the machine instructions. Non-primitive data structures are more complicated data structures and are derived from primitive data structures.
  • 9.
    Application of DataStructures • Some Applications of a Arrays are: Arrangement of leader-board of a game can be done simply through arrays to store the score and arrange them in descending order to clearly make out the rank of each player in the game. A simple question Paper is an array of numbered questions with each of them assigned to some marks. 2D arrays, commonly known as, matrix, are used in image processing. etc.,
  • 10.
    (Cont.,) • Some applicationsof a Stack are: Converting infix to postfix expressions. Undo operation is also carried out through stacks. Syntaxes in languages are parsed using stacks. It is used in many virtual machines like JVM. etc., • Queue: Operating System uses queue for job scheduling. To handle congestion in networking queue can be used. Data packets in communication are arranged in queue format. etc.,
  • 11.
    (Cont..,) • Some applicationsof a linked list are: Images are linked with each other. So, an image viewer software uses a linked list to view the previous and the next images using the previous and next buttons. Web pages can be accessed using the previous and the next URL links which are linked using linked list. The music players also use the same technique to switch between music. To keep the track of turns in a multi player game, a circular linked list is used. etc.,
  • 12.
    (Cont.,) • Some applicationsof a graph are: Facebook’s Graph API uses the structure of Graphs. Google’s Knowledge Graph also has to do something with Graph. Dijkstra algorithm or the shortest path first algorithm also uses graph structure to finding the smallest path between the nodes of the graph. GPS navigation system also uses shortest path APIs.
  • 13.
    (cont.,) • Some applicationsof the trees are: Decision-based algorithm is used in machine learning which works upon the algorithm of tree. Databases also uses tree data structures for indexing. Domain Name Server(DNS) also uses tree structures.etc.,