281710lecture Notes 3-Applications of Data Structures-1718434458689
281710lecture Notes 3-Applications of Data Structures-1718434458689
LECTURE 3 NOTES
Application of Arrays:
Arrays are the most basic data structures, storing items of the same data type. As a basic
application, arrays can be used to store data in tabular format. If we want to save our contacts
on our phones, for example, the software will simply place all of our contacts in an array.
1. The leaderboard of a game can be easily arranged using arrays to store the scores and
arrange them in descending order to clearly show the rank of each player in the game.
2. A simple question paper is an array of numbered questions, each with its own set of
marks.
String application:
2. Detection of plagiarism.
5. Spelling checkers
6. To validate the user's information in the database.
Matrix:
A matrix is an ordered collection of elements in columns and rows. The elements of a matrix
must be enclosed within brackets.
2. Used for graphing and statistics, as well as scientific studies and research in a variety
of fields.
3. Matrices are also used to represent real-world data such as the population, infant
mortality rate, and so on.
Linked List's:
A linked list is a sequence data structure, which connects elements, called nodes, through
links.
1. Images are linked to each other. As a result, image viewer software employs a linked
list to display the previous and next images via the previous and next buttons.
2. The previous and next URL links, which are linked using a linked list, can be used to
access web pages.
5. MS-Paint drawings and shapes are linked together using a linked list on canvas.
11. Used in switching between applications and programs (Alt + Tab) in the Operating
system (implemented using Circular Linked List).
12. Train coaches are linked to one another using a doubly-linked list.
Stack:
8. Call logs, e-mails, any gallery of Google photos, YouTube downloads, and notifications
(the latest appears first ).
9. After completing a Google Pay/Paytm transaction, you will receive a scratch card.
12. Last Hired, First Fired - which is commonly used when a company reduces its
workforce during an economic downturn.
13. Loading bullets into a gun's magazine. The last one in gets fired first. Bam!
15. Recursion.
Queue:
6. Photos that have been saved for uploading/downloading will be completed first (not if
there is threading).
10. A circular queue is used in a game to maintain the playing sequence of multiple
players.
11. There are three types of queues: linked list-based queues, array-based queues, and
stack-based queues.
12. Photos that have been saved for uploading/downloading will be completed first (not if
there is threading).
13. Handle website traffic
Priority Queue:
5. sort() - faster than qsort because it uses IntroSort (a hybrid of Quicksort, Heapsort,
and Insertion Sort) ()
7. Online purchasing - To sort prices into different price ranges. Flipkart and Amazon are
two examples
Graph:
3. Dijkstra algorithm, or the shortest path first algorithm, also uses graph structure to
find the smallest path between the nodes of the graph
6. Facebook, Instagram, and all social media networking sites, every user is a node
7. Data organization
Tree:
2. In machine learning, the decision-based algorithm is used, which is based on the tree
algorithm
6. When you post a question on a website like Quora, the comments are a child of the
question
1. D Game Engine.
3. Routing table