0% found this document useful (0 votes)
17 views

Parves Internship Report(GrowAI)-1 (1)

Uploaded by

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

Parves Internship Report(GrowAI)-1 (1)

Uploaded by

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

SUMMER INTERNSHIP REPORT

Submitted by

MOHAMMED PARVES A(113322243059)

In partial fulfillment for the award of the degree

Of

BACHELOR OF TECHNOLOGY

In

ARTIFICIAL INTELLIGENCE & DATA SCIENCE

VELAMMAL INSTITUTE OF TECHNOLOGY

CHENNAI 601 204

ANNA UNIVERSITY CHENNAI: 600 025


NOVEMBER 2024

i
ANNA UNIVERSITY CHENNAI:600 025
BONAFIDE CERTIFICATE

Certified that this summer internship report “DATA STRUCTURES AND


ALGORITHMS IN PYTHON” is the bonafide work of “MOHAMMED
PARVES A(113322243059)” who carried out the internship work under my
supervision.

SIGNATURE SIGNATURE

DR.S.PADMAPRIYA, M.E, Ph.D DR.S.PADMAPRIYA, M.E, Ph.D


PROFESSOR, PROFESSOR ,
HEAD OF THE DEPARTMENT, INTERNSHIP COORDINATOR ,

Artificial Intelligence & Data Science, Artificial Intelligence & Data


Science, Velammal Institute of Technology, Velammal Institute of Technology,
Velammal Gardens, Panchetti, Velammal Gardens, Panchetti,
Chennai-601 204. Chennai-601 204.

ii
iii
ACKNOWLEDGEMENT

We are personally indebted to many who had helped us during the course of this project work. Our
deepest gratitude to the God Almighty.

We are greatly and profoundly thankful to our beloved Chairman Thiru.M.V.Muthuramalingam


for facilitating us with this opportunity. Our sincere thanks to our respected Director Thiru.M.V.M
Sasi Kumar for his consent to take up this project work and make it a great success.

We are also thankful to our Advisors Shri.K.Razak, Shri.M.Vaasu, our Principal Dr.N.Balaji and
our Vice Principal Dr.S.Soundararajan for their never ending encouragement that drives
ustowards innovation.

We are extremely thankful to our Head of the Department Dr.S.PadmaPriya and Internship
coordinator Dr.S.PadmaPriya for their valuable teachings and suggestions.

From the bottom of our heart with profound reference and high regards, we would like to thank Mr
KARUNAKARAN Course Director GROWAI, who has been the pillar of this project without
whom we would not have been able to complete the project successfully.

The Acknowledgment would be incomplete if we would not mention word of thanks to our Parents.
Teaching and Non-Teaching Staffs, Administrative Staffs and Friends for their motivation and
support throughout the project. Thank you one and all.

iv
ABSTRACT

The internship onData Structures and Algorithms (DSA) in Pythonaimed to provide a comprehensive
understanding of fundamental and advanced concepts in DSA, emphasizing their implementation and
practical applications using Python. DSA forms the backboneof computational problem-solving, enabling the
development of efficient, scalable, and optimized software systems. During this internship, the focus was on
mastering core data structures such as arrays, linked lists,
stacks,queues,trees,andgraphs,alongwithalgorithmictechniqueslikesorting,searching,dynamic programming, and
greedy algorithms. Python, with its simple syntax and extensive library support, was chosen as the primary
language, making the learning process seamless and efficient. The internship also emphasized analyzing
algorithmic efficiency through time and space complexity, fostering an understanding of when and how to apply
specific data structures and algorithms.
Practical exercises and mini-projects, such as implementing library management systems or solving real-
world problems, reinforced theoretical concepts with hands-on experience. The experience culminated in a
robust understanding of DSA principles and their relevance in solving complex computational problems. The
skills acquired during this internship are essential for tackling
challengesinsoftwaredevelopment,dataanalysis,andsystemdesign,providingastrongfoundation for advanced
studies and professional growth.

v
Organization Information:

GROWAI is a dynamic edtech company specializing in creating innovative and scalable digital
solutions. Established in 2020, the company offers a wide range of services including custom
software development, web and mobile app development, cloud solutions, and AI-driven
applications. With a team of experienced engineers and developers, GROWAI delivers end-to-end
solutions from concept to deployment, focusing on performance, security, and user-centric design.
The company caters to industries such as e-commerce, healthcare, education, and finance, building
tailored solutions that help clients streamline operations, enhance customer engagement, and drive
business growth GROWAI also provides consulting services to help organizations navigate their
digital transformation journey, leveraging the latest technologies to meet business challenges
efficiently.

vi
INDEX

S.no CONTENTS Page no

1. Introduction............................................................................................................1

2. Analysis...................................................................................................................2

3. Software requirements specifications......................................................................4

4. Technology..............................................................................................................5

PYTHON......................................................................................................................5

5. Coding....................................................................................................................9

6. Outcomes................................................................................................................13

7. Conclusion.............................................................................................................17

vii
Learning Objectives/Internship Objectives

● Internships are generally thought of to be reserved for college students looking to gain
experience in a particular field. However, a wide array of people can benefit from Training
Internships in order to receive real world experience and develop their skills.

● An objective for this position should emphasize the skills you already possess in the area and
your interest in learning more

● Internships are utilized in a number of different career fields, including architecture,


engineering, Health care, economics, advertising and many more.

● Some internship is used to allow individuals to perform scientific research while others are
specifically designed to allow people to gain first-hand experience working.

● Virtual internships provide an excellent opportunity to gain practical experience and develop
skills from anywhere in the world. When applying, highlight your adaptability, communication
skills, and proficiency with digital tools, as these are vital for remote work success. Showcasing
your ability to thrive in a virtual environment can help you stand out among applicants and
improve your chances of securing the position.

viii
WEEKLY OVERVIEW OF INTERNSHIP ACTIVITIES

Week 1: Orientation and Basics of Python for DSA

Week 2: Arrays and Linked Lists

Week 3: Stacks and Queues

Week 4: Recursion and Divide-and-Conquer Algorithms

Week 5: Trees and Binary Search Trees

Week 6: Graphs and Graph Algorithms

Week 7: Dynamic Programming and Greedy Algorithms

Week 8: Project Implementation and Final Review

ix
1. INTRODUCTION

Data Structures and Algorithms (DSA) form the backbone of computer science, offering systematic ways to
process, manage, and manipulate data. They are essential for solving computational problems efficiently and
are fundamental to building robust and scalable software systems. DSA helps developers design solutions that
optimize resource utilization, ensuring faster processing and reduced memory usage.
During this internship, the primary focus was on exploring DSA concepts and their practical implementation
using Python. Python was chosen due to its clean syntax, ease of learning, and powerful built-in data
structures, making it ideal for demonstrating the concepts of DSA effectively.
Significance of DSA
1. Efficient Data Handling: Data structures provide a way to organize and access data efficiently.
2. Algorithmic Optimization: Algorithms are the tools to process this data, minimizing computation time
and memory usage.
3. Real-World Applications: From search engines to financial modeling, DSA concepts are used
extensively to solve real-world problems.
Objectives of the Internship
1. Master Core Data Structures: Understand and implement arrays, linked lists, stacks, queues, trees, and
graphs.
2. Learn Algorithmic Techniques: Study and apply sorting, searching, and optimization algorithms with an
emphasis on time and space complexity.
3. Focus on Efficiency: Analyze different algorithms to determine the best solution for specific scenarios.
4. Apply Knowledge Practically: Use Python to solve real-world problems by leveraging DSA principles.
This internship provided a comprehensive learning experience, offering insights into both the theoretical and
practical aspects of DSA. The program emphasized not only mastering the basics but also applying these
concepts to real-life problems to build efficient, scalable, and maintainable solutions. The following sections
outline the methodologies, analysis, and outcomes of this enriching experience.

x
2. ANALYSIS

The internship focused on exploring the fundamentals and applications of Data Structures and Algorithms (DSA)
in Python. The analysis phase aimed to break down the core components of DSA, their significance, and how they
contribute to solving computational problems efficiently.
Importance of DSA
1. Efficient Data Handling: Data structures provide a way to organize and store data systematically, enabling
faster access and manipulation.
2. Algorithmic Optimization: Algorithms ensure the effective use of computational resources, solving
problems with minimal time and space complexity.
3. Scalability: Properly chosen data structures and algorithms allow systems to scale and handle larger datasets
effectively.
Key Focus Areas
1. Data Structures:
● Arrays: Used for sequential data storage and manipulation. They provide constant-time access for indexed
elements but are less efficient for insertions and deletions.
● Linked Lists: Useful for dynamic memory allocation, allowing efficient insertions and deletions, though they
require sequential traversal for access.
● Stacks: Employed in scenarios like function call management, undo operations, and expression evaluation.
● Queues: Implemented for managing sequential processes like task scheduling and buffering.
● Trees: Used to represent hierarchical data, enabling efficient searching, insertion, and deletion operations.
● Graphs: Essential for modeling networks and connectivity problems, such as social networks and shortest-
path algorithms.
2. Algorithms:
● Sorting Algorithms: Techniques like Bubble Sort, Merge Sort, and Quick Sort were analyzed for their time
and space efficiency.
● Searching Algorithms: Linear Search and Binary Search were explored for their applications in data retrieval.
● Recursion: Recursive solutions were implemented for problems like tree traversals and dynamic
programming.
● Dynamic Programming and Greedy Algorithms: Used for optimization problems, providing solutions to
minimize costs or maximize outcomes.
3. Performance Analysis:
● Understanding the time complexity and space complexity of algorithms was a crucial part of the analysis.
● Benchmarked algorithms to compare their performance under different input sizes, identifying the best
solutions for specific scenarios.
Python’s Role in DSA Implementation
Python’s built-in data structures and libraries streamlined the implementation of DSA concepts:
1. Lists and Dictionaries: Efficient for representing arrays, hash tables, and adjacency lists.
2. Deque: Simplified queue and stack implementations.
3. Libraries: NumPy and Pandas facilitated handling large datasets, while Matplotlib enabled visualizing
results.
Through the analysis phase, I developed a deeper understanding of the importance of DSA in building efficient,

xi
scalable solutions for real-world problems. This foundation was essential for implementing and applying these
concepts in subsequent project tasks.

xii
3. SOFTWARE REQUIREMENTS SPECIFICATIONS

The implementation of Data Structures and Algorithms (DSA) in Python required specific software and hardware
configurations to ensure efficient execution and a smooth development process. These requirements facilitated the
practical application of theoretical concepts while enabling the handling of data-driven projects.

Hardware Requirements
● Processor: Intel Core i5 or equivalent, or higher
● RAM: At least 8 GB (16 GB recommended for handling larger datasets)
● Storage: Minimum 50 GB of free disk space for data storage and tools installation
● Graphics: A basic GPU (optional, for data visualization tasks or larger computations)

Software Requirements
Operating System
● Windows 10/11, Linux (Ubuntu recommended), or macOS
Programming Environment
● Python Version: Python 3.8 or newer for compatibility with modern libraries and frameworks
Integrated Development Environments (IDEs)
● Jupyter Notebook: For interactive coding and visualization
● PyCharm: For structured project development and debugging
● Visual Studio Code: As a lightweight option for scripting and testing
Python Libraries
1. Core Libraries:
o NumPy: For numerical computations and efficient array handling
o Pandas: For data manipulation and processing
2. Algorithm Implementation Support:
o heapq: For priority queue implementations
o collections: For deque and other specialized data structures
3. Visualization:
o Matplotlib: For graphing and visual representation of algorithm outcomes
o Seaborn: For enhanced statistical data visualization (optional)
Additional Tools
● Version Control: Git for version management and collaboration
● Package Manager: pip or conda for installing Python libraries

xiii
4. TECHNOLOGY

The implementation of Data Structures and Algorithms (DSA) during the internship leveraged Python as the primary
programming language. Python's simplicity, versatility, and rich library ecosystem made it an excellent choice for
both learning and practical applications of DSA. The following section highlights the technologies and tools utilized
throughout the internship.

Python for DSA


Python is a powerful, high-level programming language known for its readable syntax and extensive support for
computational tasks. Its built-in data structures and dynamic typing capabilities make it particularly suitable for DSA
implementation.
Advantages of Python for DSA:
1. Ease of Use: Python’s simple syntax reduces the learning curve and allows a strong focus on DSA
concepts.
2. Built-in Data Structures: Python provides efficient implementations of lists, dictionaries, sets, and more,
which are crucial for DSA tasks.
3. Extensive Library Support: Libraries like NumPy, Pandas, and collections enhance Python's capability to
handle large datasets and complex algorithms.
4. Community and Documentation: Python’s large community and extensive documentation provide ample
resources for troubleshooting and learning.

Data Structures in Python


Python’s built-in and external modules facilitated the efficient implementation of various data structures:
1. Arrays:
o Implemented using Python lists, which support dynamic sizing and indexing.
o Enhanced using NumPy for performance optimization.
2. Linked Lists:
o Created manually to understand memory allocation and node-based structure.
FIFOoperations. xiii
3. Stacks and Queues:
o Built using Python lists and the collections.deque module for optimal performance in LIFO and

FIFOoperations. xiii
4. Trees and Graphs:
o Represented using custom classes and adjacency lists.
o Visualized with Matplotlib for better comprehension.

Algorithm Implementation
Python provided the tools to implement various algorithms with minimal overhead:
1. Sorting and Searching:
o Native Python functions like sorted() and libraries like heapq offered efficient sorting solutions.
o Custom implementations of Merge Sort, Quick Sort, and Binary Search were developed for a
deeper understanding.
2. Dynamic Programming and Greedy Algorithms:
o Python’s support for recursion and memoization via the functools library simplified the
development of these algorithms.
3. Graph Algorithms:
o BFS and DFS were implemented using adjacency lists and recursion.
o NetworkX (optional library) was used for more complex graph analyses.

Tools and Libraries


1. Core Libraries:
o NumPy: Enhanced array manipulation and numerical computations.
o Pandas: Simplified data handling and preprocessing.
2. Visualization:
o Matplotlib: Used for creating graphs to visualize algorithmic performance and data structure
behaviors.
o Seaborn: Provided advanced data visualization with minimal code.
3. Optimization Tools:
o heapq: Facilitated the implementation of priority queues.
o collections: Used for specialized data structures like deque and Counter.
4. IDE and Development Tools:
o Jupyter Notebook: Ideal for interactive coding and step-by-step debugging.
o PyCharm and Visual Studio Code: Provided structured development environments with enhanced
debugging capabilities.

xiv
Why Python?
Python's flexibility and diverse library ecosystem enabled efficient implementation of complex algorithms and data
structures, making it the preferred language for this internship. The ease of prototyping and analyzing results,
combined with its vast community support, ensured a productive learning experience.
This robust technological setup played a vital role in exploring, implementing, and optimizing DSA concepts
during the intern
ship. It also provided valuable hands-on experience with tools and libraries used widely in the industry.

xv
5.CODING (Project Done In Internship Program)

The practical implementation of DSA concepts in Python was a key part of this Internship. Here, I
showcase the application of DSA techniques in “Online Ticket Booking System (Using Queues and
Trees)” as a case study.

Online Ticket Booking System (Using Queues and Trees)

class Node:
def init (self, seat_number):
self.seat_number = seat_number
self.left = None
self.right = None

class BST:
def init (self): self.root =
None

# Insert seat number in the BST to keep seats sorted


def insert(self, seat_number): if
not self.root:
self.root = Node(seat_number) else:
self._insert(self.root, seat_number)

def _insert(self, node, seat_number):


if seat_number < node.seat_number: if
node.left is None:
node.left = Node(seat_number)
else:
self._insert(node.left, seat_number) elif
seat_number > node.seat_number:
if node.right is None:
node.right = Node(seat_number) else:
self._insert(node.right, seat_number)

# Search for a seat number in the BST


def search(self, seat_number):
return self._search(self.root, seat_number)

def _search(self, node, seat_number):


if node is None or node.seat_number == seat_number:
return node
elif seat_number < node.seat_number:
return self._search(node.left, seat_number) else:
return self._search(node.right, seat_number)

# Remove a seat from the BST (mark it as booked)


def delete(self, seat_number):
self.root = self._delete(self.root, seat_number)

def _delete(self, node, seat_number): if


node is None:
return node

if seat_number < node.seat_number:


node.left = self._delete(node.left, seat_number) elif
seat_number > node.seat_number:
node.right = self._delete(node.right, seat_number) else:
# Node with only one child or no child
if node.left is None: return
node.right
elif node.right is None:
return node.left

# Node with two children


node.seat_number = self._min_value_node(node.right).seat_number node.right
= self._delete(node.right, node.seat_number)

return node

def _min_value_node(self, node): current


= node
while current.left is not None: current =
current.left
return current

# Inorder traversal to print all available seats


def inorder(self): seats =
[]
self._inorder(self.root, seats)
return seats

def _inorder(self, node, seats): if


node:
self._inorder(node.left, seats)
seats.append(node.seat_number)
self._inorder(node.right, seats)

class TicketBookingSystem: def


init (self):
self.bst = BST()
self.queue = []
self.booked_seats = set() # To track booked seats

# Add booking request to the queue


def request_booking(self, user_name):
self.queue.append(user_name)

# Process booking requests


def process_booking(self): if
not self.queue:
print("No booking requests in the queue.") return

user_name = self.queue.pop(0) # First come, first served


available_seats = self.bst.inorder() if
available_seats:
seat = available_seats[0] # Assign the first available seat self.bst.delete(seat) #
Remove the seat from BST self.booked_seats.add(seat)
print(f"Booking successful for {user_name}. Seat {seat} is booked.") else:
print(f"No available seats for {user_name}.")

# Cancel booking (remove seat from booked set and add back to BST)
def cancel_booking(self, user_name, seat_number): if
seat_number not in self.booked_seats:
print(f"Seat {seat_number} is not booked.")
return
self.bst.insert(seat_number) # Add the seat back to BST
self.booked_seats.remove(seat_number)
print(f"Booking canceled for {user_name}. Seat {seat_number} is now available.")

# Display available seats


def show_available_seats(self): available_seats
= self.bst.inorder() print("Available seats:",
available_seats)

# Sample usage
def main():
system = TicketBookingSystem()

# Insert some available seats in the BST


for seat in range(1, 11):
system.bst.insert(seat)

# Display initial available seats


print("Initial available seats:")
system.show_available_seats()

# Add booking requests to the queue


system.request_booking("User1")
system.request_booking("User2")
system.request_booking("User3")

# Process bookings
system.process_booking() # User1 books a seat
system.process_booking() # User2 books a seat
system.process_booking() # User3 books a seat

# Show remaining available seats


system.show_available_seats()

# Cancel a booking
system.cancel_booking("User2", 2)
# Show available seats after cancellation
system.show_available_seats()
# Process another booking request
system.process_booking() # User4 books a seat

if name == " main ":


main()
OUTPUT

Initialavailableseats:
Available seats: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
BookingsuccessfulforUser1.Seat1isbooked.
BookingsuccessfulforUser2.Seat2isbooked.
BookingsuccessfulforUser3.Seat3isbooked. Available
seats: [4, 5, 6, 7, 8, 9, 10]
BookingcanceledforUser2.Seat2isnowavailable.
Availableseats:[2,4,5,6,7,8,9,10]
BookingsuccessfulforUser4.Seat2isbooked.

6. OUTCOMES:

● Queue: Ensures that booking requests are processed in the order they arrive (FIFO).
● BST: Efficiently manages available seats, enabling quick seat assignment and ensuring seats are always in
sorted order.
● Canceling Bookings: When a user cancels a booking, the seat is returned to the BST, making it available
for future bookings.
● Booking Flow: The system processes booking requests in the order they are received and assigns available
seats to the first user in the queue.

This implementation demonstrates the use of Queues for managing booking requests and Binary Search Trees (BST)
for efficiently managing available seats in an online ticket booking system.
7. CONCLUSION

The internship focused on mastering the concepts of Data Structures and Algorithms (DSA) in Python, providing a
strong foundation in one of the most critical areas of computer science. By exploring the design, implementation, and
optimization of various data structures and algorithms, the program emphasized the importance of solving
computational problems efficiently and effectively.
Achievements
1. Understanding Core Data Structures:
o Arrays, linked lists, stacks, queues, trees, and graphs were implemented and analyzed to understand
their strengths and limitations.
o Their applications in real-world scenarios, such as task scheduling, hierarchical data representation,
and network modeling, were explored in depth.
2. Algorithmic Mastery:
o A variety of algorithms, including sorting (Quick Sort, Merge Sort), searching (Binary Search), and
optimization techniques (Dynamic Programming, Greedy Algorithms), were developed and tested.
o The emphasis on recursive and iterative approaches fostered a deeper understanding of algorithmic
design.
3. Efficiency Analysis:
o Learning to analyze time and space complexities using Big-O notation enhanced the ability to evaluate
and compare algorithms.
o Benchmarking implementations on different input sizes provided insights into the trade-offs involved
in choosing specific data structures or algorithms.
4. Real-World Applications:
o The integration of DSA into practical scenarios demonstrated their relevance in software development,
data analysis, and system design.
o Python's libraries, such as NumPy and Pandas, further facilitated the handling of large datasets, while
Matplotlib and Seaborn were instrumental in visualizing algorithm performance.
Broader Impact
This internship not only strengthened my technical skills but also enhanced my problem-solving mindset. It bridged
the gap between theoretical knowledge and its practical application, preparing me for real-world challenges in
technology and beyond. Additionally, Python's simplicity and its vast ecosystem provided an ideal platform for
implementing and experimenting with DSA concepts, reinforcing my confidence in applying these skills across
various domains.
Future Directions
The knowledge and experience gained during this internship will serve as a cornerstone for tackling advanced topics
such as machine learning, system design, and big data analysis. Moreover, the ability to evaluate and implement
efficient solutions will prove invaluable in optimizing real-world systems.
Overall, the internship was a transformative experience, providing a well-rounded understanding of DSA principles
and their application in Python, setting the stage for continued learning and professional growth.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy