This document discusses data types and applications of data structures. It defines primitive, derived, and user-defined data types. Abstract data types (ADT) like stacks, queues, and lists are introduced along with their common operations. Various data structures - primitive, non-primitive, arrays, stacks, queues, linked lists, graphs, and trees - are described. Finally, examples of applications of these data structures are provided such as arranging game leaderboards with arrays, converting expressions with stacks, job scheduling with queues, viewing images with linked lists, social networks with graphs, and decision-making with trees.
3. (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.
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 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
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
8. (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.
9. 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.,
10. (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.,
11. (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.,
12. (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.
13. (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.,