Professional Documents
Culture Documents
Dsa 2 Assign
Dsa 2 Assign
Dsa 2 Assign
BELAGAVI
An ASSIGNMENT REPORT
Submitted as subject assignment work,
for the subject
Data Structures and Applications (BCS304)
By
KAVYASHREE
4AL22CS074
CERTIFICATE
INDEX
Virtual Lab
Introduction:
In this report, I aim to elucidate the virtual lab concept and its role in my learning
process. Within the virtual lab environment, I extensively explored three pivotal
concepts in data structures and applications.
They are, Linked Lists, Binary Search Trees, and Graphs. Through interactive
modules and guided exercises, I learned many things in these topics.
Virtual Labs is a project initiated by the Ministry of Education, Government of
India, under the National Mission on Education through Information and
Communication Technology. The project aims to provide remote access to
Laboratories in various disciplines of Science and Engineering for students at all
levels from undergraduate to research.
Virtual Labs have been designed to provide remote access to labs in various
disciplines of Science and Engineering. These Virtual Labs cater to students at the
undergraduate level, postgraduate level as well as to research scholars.
Virtual Labs enable the students to learn at their own pace and enthuse them to
conduct experiments. Virtual Labs also provide a complete learning management
system where the students can avail various tools for learning, including additional
web resources, video lectures, animated demonstration, and self-evaluation. Virtual
Labs can be used to complement physical labs.
In the virtual lab concept, numerous topic options are available for selection,
covering a wide array of subjects. Each subject encompasses multiple topics, and
within each topic, explanations are provided succinctly, making them easily
understandable. Additionally, practice questions are included to reinforce learning,
and quizzes are available to assess comprehension.
1. Linked Lists
Linked List is a linear data structure, in which elements are not stored at a
contiguous location, rather they are linked using pointers. Linked List forms a
series of connected nodes, where each node stores the data and the address of the
next node.
1. Single-linked list:In a singly linked list, each node contains a reference to the
next node in the sequence. Traversing a singly linked list is done in a forward
direction.
2. Double-linked list:
In a doubly linked list, each node contains references to both the next and previous
nodes. This allows for traversal in both forward and backward directions, but it
requires additional memory for the backward reference.
1. Insertion: Adding a new node to a linked list involves adjusting the pointers of the
existing nodes to maintain the proper sequence. Insertion can be performed at the
beginning, end, or any position within the list
2. Deletion: Removing a node from a linked list requires adjusting the pointers of the
neighboring nodes to bridge the gap left by the deleted node. Deletion can be
performed at the beginning, end, or any position within the list.
3. Searching: Searching for a specific value in a linked list involves traversing the list
from the head node until the value is found or the end of the list is reached.
A Binary Search Tree (BST) is a special type of binary tree in which the left child
of a node has a value less than the node’s value and the right child has a value
greater than the node’s value. This property is called the BST property and it
makes it possible to efficiently search, insert, and delete elements in the tree.
The root of a BST is the node that has the smallest value in the left subtree and the
largest value in the right subtree. Each left subtree is a BST with nodes that have
smaller values than the root and each right subtree is a BST with nodes that have
larger values than the root.
Binary Search Tree is a node-based binary tree data structure that has the following
properties:
1. The left subtree of a node contains only nodes with keys lesser than the node’s key.
2. The right subtree of a node contains only nodes with keys greater than the node’s
key.
3. This means everything to the left of the root is less than the value of the root and
everything to the right of the root is greater than the value of the root. Due to this
performing, a binary search is very easy.
4. The left and right subtree each must also be a binary search tree.
There are three steps to traverse the binary search tree. They are,
1.Inorder Traversal:
At first traverse left subtree then visit the root and then traverse the right subtree.
Follow the below steps to implement the idea:
2.Preorder Traversal:
At first visit the root then traverse left subtree and then traverse the right subtree.
Follow the below steps to implement the idea:
3.Postorder Traversal:
At first traverse left subtree then traverse the right subtree and then visit the root.
Follow the below steps to implement the idea:
3. Graphs:
A Graph is a non-linear data structure consisting of vertices and edges. The vertices
are sometimes also referred to as nodes and the edges are lines or arcs that connect
any two nodes in the graph. More formally a Graph is composed of a set of vertices
( V ) and a set of edges ( E ). The graph is denoted by G (V, E).
Graph data structures are a powerful tool for representing and analysing complex
relationships between objects or entities. They are particularly useful in fields such
as social network analysis, recommendation systems, and computer networks. In
the field of sports data science, graph data structures can be used to analyse and
understand the dynamics of team performance and player interactions on the field.
Components of a Graph
Vertices: Vertices are the fundamental units of the graph. Sometimes, vertices are
also known as vertex or nodes. Every node/vertex can be labeled or unlabelled.
Edges: Edges are drawn or used to connect two nodes of the graph. It can be
ordered pair of nodes in a directed graph. Edges can connect any two nodes in any
possible way. There are no rules. Sometimes, edges are also known as arcs. Every
edge can be labelled/unlabelled.
Reference:
Virtual lab, Geeks for Geeks