0% found this document useful (0 votes)
33 views19 pages

Data Structures and Logarithms

Uploaded by

Taroy Charlize
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views19 pages

Data Structures and Logarithms

Uploaded by

Taroy Charlize
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Data Structures and

Algorithms

Group 6
Structured vs. Unstructured Data:
What’s the Difference?
Structured and unstructured data differ in many ways, however, the
primary difference between the two is that structured data is defined
and searchable while unstructured data is contained in its native form.

Structured data- quantitative, stored in data warehouses, can be


immediately analyzed, and follows predefined formats.

Unstructured data- qualitative, contained in data lakes, requires


processing and transformation, and comes in many different formats.
Data structures and algorithms
(DSA) are an important aspect of
any programming language. Every
language has its own data
structures and its way of handling
different types of algorithms.
What is Data
Structure?

-A data structure is a particular


way data is arranged so it can be
saved in memory and retrieved
for later use.
What Are
Different Data
Structures?
Linear data structures

Tree data structures

Hash data structures

Graph data structures.


Different Data Structures
1. LINEAR DATA STRUCTURES
Data structure where data elements are arranged
sequentially or linearly where each and every element is attached
to its previous and next adjacent is called a linear data structure.
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. Its examples are array, stack, queue, linked list, etc.
Different Data Structures
a. Array
The array is a type of data structure that stores elements of the
same type. These are the most basic and fundamental data
structures. Data stored in each position of an array is given a
positive value called the index of the element. The index helps in
identifying the location of the elements in an array.
b. Stack
The data structure follows the rule of LIFO (Last In-First Out)
where the data last added element is removed first. Push
operation is used for adding an element of data on a stack and
the pop operation is used for deleting the data from the stack.
This can be explained by the example of books stacked together.
In order to access the last book, all the books placed on top of the
last book have to be safely removed.
Different Data Structures
c. Queue
This structure is almost similar to the stack as the data is
stored sequentially. The difference is that the queue data structure
follows FIFO which is the rule of First In-First Out where the first
added element is to exit the queue first. Front and rear are the two
terms to be used in a queue.
Enqueue is the insertion operation and dequeue is the
deletion operation. The former is performed at the end of the
queue and the latter is performed at the start end.
Different Data Structures
d. Linked list
Linked list are the types where the data is stored in the
form of nodes which consist of an element of data and a pointer.
The use of the pointer is that it points or directs to the node which
is next to the element in the sequence. The data stored in a linked
list might be of any form, strings, numbers, or characters. Both
sorted and unsorted data can be stored in a linked list along with
unique or duplicate elements.
c. Hash Tables
These types can be implemented as linear or non-linear
data structures. The data structures consist of key-value pairs.
Different Data Structures
2. Non-linear Data Structure:
Data structures where data elements are not arranged
sequentially or linearly are called non-linear data structures. In a
non-linear data structure, single level is not involved. Therefore,
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. Its examples are trees and
graphs.
Different Data Structures
a. Trees
-A tree data structure consists of various nodes linked
together. The structure of a tree is hierarchical that forms a
relationship like that of the parent and a child. The structure of the
tree is formed in a way that there is one connection for every parent-
child node relationship. Only one path should exist between the root
to a node in the tree. Various types of trees are present based on their
structures like AVL tree, binary tree, binary search tree, etc.
Different Data Structures
b. Graph
-Graphs are those types of non-linear data structures which
consist of a definite quantity of vertices and edges. The vertices or the
nodes are involved in storing data and the edges show the vertices
relationship. The difference between a graph to a tree is that in a
graph there are no specific rules for the connection of nodes. Real-life
problems like social networks, telephone networks, etc. can be
represented through the graphs.
Each programming language has its own way
of implementing those data structures. In the
same vein, each programming language has
its own data structures exclusive to it. For
example, Python has unique data types like
tuples, lists, and dictionaries:
Example
What is 1. Start by declaring a variable `score` to store the input score.
Algorithm? 2. Read the input score from the user.

3. Use conditional statements to determine the grade based


In programming, an algorithm is a set
of steps for solving a known problem. on the score:
The problems solved by an algorithm
- If the score is greater than or equal to 90, assign the grade
could be sorting a set of data,
searching through available data, or . as 'A'.
even encrypting data.
- If the score is between 80 and 89, assign the grade as 'B'.

- If the score is between 70 and 79, assign the grade as 'C'.

- If the score is between 60 and 69, assign the grade as 'D'.

- If the score is less than 60, assign the grade as 'F'.

4. Print the grade to the console.


Types of Algorithm
There are a number of types of algorithms available today.
There’s no particular way the types are characterized, but
there are broad categories like sorting and searching
algorithms.
Sorting algorithms: Searching algorithms:
merge sort exponential search
bubble sort binary search
selection sort, and others. jump search, and others.
There are other types of algorithms like hashing, greeting
algorithms, brute force algorithms, and more.
In Which Language Should I Write Algorithms?

ANY!
-You can write algorithms with any programming language out
there. Each programming language has its way of
implementing a particular algorithm.

03
-But in some instances, choosing a language to write an
algorithm depends on the exact programming language you’re
using in your project.
REFERENCES
Chris, K. (2023, February 2). Learn data structures and algorithms – introduction
and learning resources. freeCodeCamp.org.
https://www.freecodecamp.org/news/learn-data-structures-and-algorithms/
GeeksforGeeks. (2023, February 28). Difference between linear and non-linear data
structures. GeeksforGeeks. https://www.geeksforgeeks.org/difference-between-
linear-and-non-linear-data-structures/
Linear Search algorithm | example | time complexity | gate vidyalay. (n.d.-a).
https://www.gatevidyalay.com/linear-search-searching-algorithms/

You might also like