Debug School

rakesh kumar
rakesh kumar

Posted on

Algorithms:Real-time application of Data Structures


Data Structures are a specialized means of organizing and storing data in computers in such a way that we can perform operations on the stored data in a more efficient manner.
In this article we will explore some of real time application of data structures such as arrays, stack, queue, graph and tree.
So let’s get started with linear data structures

  1. Arrays: Arrays are one of the linear and simplest data structures that stores items of the same data type.

Image description

a. Array in phone contact app: As we all save any of the new contact number in our phone’s contact app and it contains a lot of contact numbers. They are stored in the form of an array. When we add or delete a contact in our phone, this is similar to adding or deleting elements in an array.
b. Arrays in online shopping platforms :In day-to-day life many of the user order products through online platforms. Many of the time users add the products that they wish to buy to the cart section. The server stores the ordered products in the form of an array elements only.
c. Array in matrices :In mathematics we use matrices isn’t it? They are nothing but the form of 2 Dimensional arrays. Matrices are widely used in marking surveys which is an efficient way. Also in geology, matrices represent the seismic survey.



:A Stack is a widely used linear data structure which follows LIFO(Last In First Out) mechanism.

Image description

a. Text Editors: In the various Text Editors like Excel, Notepad or WordPad etc. we all known these two operations of “Undo and Redo”. So through stack data structure these mechanism in the Text Editors could be easily achieved.
b. Mobile Phone: Call log, E-mails, Google photos’ any gallery , YouTube downloads, Notifications in mobiles uses the stack so that the latest one appears first.
c. Evaluation of Arithmetic Expressions: Stack is a very effective data structure for evaluating arithmetic expressions as we known arithmetic expressions consists of operands and operators ,expression may also include parenthesis like left parenthesis and right parenthesis so through different notations for arithmetic expression and using stack data structure arithmetic expressions could be easily evaluated.



: A Queue is also a linear data structure but it follows FIFO(First In First Out) mechanism.

Image description

a. Handling of interrupts: Handling of interrupts in real time systems as the interrupts are handled in the same order as they arrive i.e. First come first served so through queue data structure it could be efficiently handled out.
b. Operating systems: In operating system for handling Semaphores mechanism ,FCFS ( first come first serve) scheduling example: FIFO queue, Spooling in printers ,Buffer for devices like keyboard queue data structure is used.
c. Asynchronous Data Transfer: Queues are used in asynchronous transfer of data where data is not being transferred at the same rate between two processes for eg. pipes, file IO, sockets.


: Graph is a non-linear data structure consisting of nodes and edges which connect a pair of nodes.

Image description

a. Facebook’s Graph API: On Graph API, everything is a vertices or node. Vertices are entities such as Users, Pages, Places, Groups, Comments, Photos etc. And every connection or relationship is an edge. So in these way Graph API uses this collections of vertices and edges to store its data.
b. Google maps: Google maps uses graphs for building transportation systems, where intersection of two(or more) roads are considered to be a vertex and the road connecting two vertices is considered to be an edge between them, their navigation system is based on the algorithm to calculate the shortest path between two vertices.
c. Flight Networks: Using graph models, airport procedures can be modeled and optimized efficiently. In flight network, graph data structures are used to compute shortest paths and fuel usage in route planning, often in a multi-modal context.


: A tree data structure is a non-linear and hierarchical structure as elements in a tree are arranged in multiple levels.

Image description

a. Machine learning algorithms: As we known machine learning domain has variety range of algorithms in which many of the Decision-based algorithm works upon the algorithm of tree data structure.
b. Artificial intelligence games: In Artificial intelligence games in which opponent is CPU so the next moves are stored using tree data structure.
c. Data mining research: Decision Tree based Learning actually forms a strong area of data mining research field. As there are numerous famous methods exist like bagging, boosting, and modifications thereof which work on trees. Such work is often used to generate a predictive model.

In these way there are various applications of data structures in our day to day life for efficiently handling out various small and big tasks.

  1. Arrangement of the 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.
  2. A simple question Paper is an array of numbered questions with each of them assigned some marks.
  3. 2D arrays, commonly known as, matrices, are used in image processing.
  4. It is also used in speech processing, in which each speech signal is an array.
  5. Your viewing screen is also a multidimensional array of pixels.
  6. Book titles in a Library Management Systems.
  7. Online ticket booking.
  8. Contacts on a cell phone.
  9. For CPU scheduling in computer.
  10. To store the possible moves of chess on a chessboard.
  11. To store images of a specific size on an android or laptop.

Application of Strings


  1. Spam email detection.
  2. Plagiarism detection.
  3. Search engine.
  4. Digital forensic and information retrieval system
  5. Spell checkers.
  6. In the database to check valid information of the user

Top comments (0)