Professional Documents
Culture Documents
Samiksha DSA
Samiksha DSA
On
Data Structure and Algorithm
Submitted for
Evaluation of Internship-II
(BECP-507)
Submitted For
Bachelor of Technology
In
Electronics and Communication Engineering
At
INDEX
S. No. Content Page No.
1. Introduction to DSA
What is Data Structure?
What is Algorithm?
What is Data Structure and
Algorithm?
2. Real life examples of DSA
What is Algorithm?
An algorithm is a process or a set of rules required to perform
calculations or some other problem-solving operations especially by a
computer. The formal definition of an algorithm is that it contains the
finite set of instructions which are being carried in a specific order to
perform the specific task. It is not the complete program or code; it is
just a solution (logic) of a problem, which can be represented either as
an informal description using a Flowchart or Pseudocode.
Array
Stack
Queue
Linked List
I. Array:
Arrays are defined as the collection of similar types of data items stored at
contiguous memory locations. It is one of the simplest data structures
where each data element can be randomly accessed by using its index
number.
In C programming, they are the derived data types that can store the
primitive type of data such as int, char, double, float, etc. For example, if we
want to store the marks of a student in 6 subjects, then we don't need to
define a different variable for the marks in different subjects. Instead, we
can define an array that can store the marks in each subject at the
contiguous memory locations.
Properties of array:
There are some of the properties of an array that are listed as follows:
o Each element in an array is of the same data type and carries the
same size that is 4 bytes.
o Elements in the array are stored at contiguous memory locations
from which the first element is stored at the smallest memory
location.
o Elements of the array can be randomly accessed since we can
calculate the address of each element of the array with the given
base address and the size of the data element.
II. Queue:
A queue can be defined as an ordered list which enables insert operations
to be performed at one end called REAR and delete operations to be
performed at another end called FRONT.
For example, people waiting in line for a rail ticket form a queue.
Properties of Queue:
There are some of the properties of an queue that are listed as follows:
o FIFO Order: Elements are removed from the queue in the same
order they were added.
o Front and Rear: Queues have two ends: the front and the rear.
Elements are added to the rear and removed from the front.
o Enqueue Operation: Enqueueing an element inserts it into the
rear of the queue.
o Dequeue Operation: Dequeueing an element removes it from
the front of the queue.
o Empty and Full Checks: Queues can be checked for emptiness
or fullness depending on their implementation.
o Bounded or Unbounded: Queues can have a fixed size
(bounded) or grow dynamically (unbounded).
III. Stack:
A Stack is a linear data structure that follows the LIFO (Last-In-First-
Out) principle. Stack has one end, whereas the Queue has two ends
(front and rear). It contains only one pointer top pointer pointing to
the topmost element of the stack. Whenever an element is added in
the stack, it is added on the top of the stack, and the element can be
deleted only from the stack. In other words, a stack can be defined as
a container in which insertion and deletion can be done from the one
end known as the top of the stack.
PUSH operation:
POP operation:
Till now, we were using array data structure to organize the group of
elements that are to be stored individually in the memory. However,
Array has several advantages and disadvantages which must be
known in order to decide the data structure which will be used
throughout the program.
Linked list is the data structure which can overcome all the
limitations of an array. Using linked list is useful because,
Tree
Graph
Tree:
Graph:
A graph can be defined as group of vertices and edges that are used to
connect these vertices. A graph can be seen as a cyclic tree, where the
vertices (Nodes) maintain any complex relationship among them
instead of having parent child relationship.
Adjacency Matrix
Adjacency List
Adjacency Matrix:
The Adjacency Matrix is a V×V matrix where the values are filled
with either 0 or 1. If the link exists between Vi and Vj, it is recorded
1; otherwise, 0.
The puzzle is typically played with three rods, but can be played with
any number of rods. The number of moves required to solve the
puzzle is 2n-12, where n is the number of disks.
Output:
CONCLUSION
My Data Structure and Algorithm internship at Yhills has been an
invaluable experience that has provided me with a deep understanding
of data structures and algorithms and their application in real-world
scenarios. I have gained hands-on experience in designing,
implementing, and testing various data structures and algorithms, and
I have learned how to choose the right data structures and algorithms
for specific tasks. I have also developed my problem-solving skills
and my ability to think critically about complex problems.