MASTER DSA WITH JAVA/C++
W3GRADS
A training report
Submitted in partial fulfilment of the requirements for the award of degree of
[Link] (Computer Science And Engineering)
Submitted to
LOVELY PROFESSIONAL UNIVERSITY
PHAGWARA, PUNJAB
From 10/06/2025 to 30/07/2025
SUBMITTED BY
Name of student: Abhinav Yadav
Registration Number: 12320838
Signature of the student: Abhinav
DECLARATION
I, Abhinav Yadav, 12320838 hereby declare that the work done by me on “Master DSA with
Java/C++” from June, 2025 to July, 2025, is a record of original work for the partial fulfilment
of the requirements for the award of the degree, BTech Computer Science And Engineering.
Name of the Student: Abhinav Yadav
Registration Number: 12320838
Signature of the student: Abhinav
Dated: August,2025
SUMMER TRAINING CERTIFICATE
ACKNOWLEDGEMENT
I would like to express my sincere gratitude to W3Grads for offering the "Master DSA with Java and
C++" course, which has been an invaluable learning experience. This program has provided me with
a solid foundation in Data Structures and Algorithms, strengthening my problem-solving skills and
equipping me with the knowledge to implement efficient solutions in both Java and C++.
I extend my heartfelt thanks to the instructors, whose expertise and guidance have been instrumental
in my learning journey. Their well-structured lessons, practical coding examples, and clear
explanations have greatly enhanced my understanding of complex concepts.
I am also grateful to the support staff and fellow learners who have contributed to an engaging and
collaborative learning environment. The projects, coding challenges, and hands-on exercises included
in the course have allowed me to apply theoretical knowledge to real-world programming problems,
thereby deepening my practical skills.
Lastly, I appreciate the opportunity to be part of the W3Grads learning community, where I have
gained not only technical expertise but also the confidence to apply these skills in my future
endeavours. This course has been a significant step forward in my professional development, and I
look forward to continuing my learning journey.
Thank you.
Abhinav Yadav
CONTENTS
1. INTRODUCTION OF THE PROJECT UNDERTAKEN
2. INTRODUCTION OF THE COMPANY/WORK
3. BRIEF DESCRIPTION OF THE WORK DONE
4. CONCLUSION
5. REFERENCES
INTRODUCTION OF THE PROJECT UNDERTAKEN
Objectives of the work undertaken
"Master DSA with Java and C++" course at W3Grads aimed to build a strong foundation in Data
Structures and Algorithms while enhancing logical thinking and problem-solving abilities. The work
focused on mastering both basic and advanced data structures, including arrays, linked lists, stacks,
queues, trees, graphs, heaps, and hash tables, along with implementing various searching, sorting, and
optimization techniques. Emphasis was placed on understanding algorithmic complexity, recursion,
and dynamic programming to design efficient solutions. Additional objectives included improving
debugging skills, following industry-standard coding practices, and exploring the differences in DSA
implementation between Java and C++. Through regular coding challenges, projects, and peer
collaboration, the work provided practical exposure, strengthened analytical skills, and built
confidence for competitive programming and technical interviews. Ultimately, the concepts learned
were directed toward real-world software projects and professional growth in software development.
Scope of the Work
1. Covers fundamental concepts of Data Structures and Algorithms from basic to advanced level.
2. Includes implementation of DSA concepts in both Java and C++.
3. Focuses on analysing time and space complexity of algorithms.
4. Provides practical exposure through coding challenges and problem-solving exercises.
5. Encompasses basic structures like arrays, linked lists, stacks, and queues.
6. Extends to advanced structures such as trees, graphs, heaps, and hash tables.
7. Covers multiple algorithmic approaches including recursion and dynamic programming.
8. Encourages competitive programming practices for speed and accuracy.
9. Provides hands-on projects for real-world application of learned concepts.
10. Enhances debugging, optimization, and code refactoring skills.
Importance and Applicability
Mastering Data Structures and Algorithms (DSA) is essential for building efficient,
scalable, and reliable software systems. This work enhances problem-solving abilities,
strengthens logical thinking, and equips learners to design optimized solutions for
real-world applications. Proficiency in both Java and C++ broadens career
opportunities by enabling flexibility in different programming environments and
industry demands. The concepts learned are directly applicable to competitive
programming, technical interviews, and coding assessments, giving a competitive
edge in placements and professional opportunities. Beyond academic benefits, DSA
knowledge supports the development of high-performance applications in domains
such as web development, game development, database systems, artificial
intelligence, and large-scale data processing. The skills gained are also relevant in
optimizing existing systems, reducing resource consumption, and improving
execution speed, making them valuable for both startups and established tech
companies. Ultimately, the applicability spans from individual coding projects to
enterprise-grade software solutions, ensuring long-term professional growth.
Role and profile Role:
Actively participated as a learner in the "Master DSA with Java and C++" program at
W3Grads, engaging in structured lessons, coding challenges, and practical projects
aimed at building strong problem-solving and programming skills.
Profile:
• Focused on mastering Data Structures and Algorithms with implementation
in Java and C++.
• Solved a variety of problems covering arrays, linked lists, stacks, queues,
trees, graphs, heaps, and hash tables.
• Practiced algorithmic techniques such as searching, sorting, recursion, and
dynamic programming.
• Analysed time and space complexity to design efficient solutions.
• Applied coding best practices and followed industry standards for clean,
optimized code.
• Participated in collaborative problem-solving sessions with peers.
• Completed projects and exercises to simulate real-world applications.
• Prepared for technical interviews and competitive programming contests.
INTRODUCTION OF W3GRADS
Company’s Vision and Mission
W3Grads envisions bridging the gap between traditional textbook learning and the dynamic
demands of the modern software industry by becoming a premier training institute that produces
industry-ready professionals. With a focus on practical, hands-on learning, the organization strives
to equip learners with the skills, confidence, and adaptability required to excel in real world
technology roles.
The mission of W3Grads is to empower aspiring developers and professionals through training
programs designed in alignment with actual corporate requirements. By offering expert-led,
project-based learning in cutting-edge technologies, W3Grads aims to transform fresh graduates
and working professionals into competent, job-ready talent capable of contributing effectively in
the competitive IT landscape.
Origin and growth of company
W3Grads was founded as a non-profit organization with the core aim of bridging the gap between
outdated textbook knowledge and industry-relevant skills for aspiring programmers and developers.
Comprising a team of seasoned professionals across various domains of web and software
development, W3Grads meticulously curates its training programs to align with real-world challenges.
Since its inception—serving primarily the Kanpur region—the institute has expanded its reach by
delivering a wide range of online, hands-on training programs, spanning technologies like Ruby on
Rails, Blockchain, Python, JavaScript frameworks, and mobile application development. With a
commitment to diversity, curation, and quality, W3Grads has consistently enriched its offerings,
enabling learners to become industry-ready through live classes, personal mentoring, project work,
and placement assistance.
Various departments and their functions
Training and Development Department
• Designs and delivers hands-on training programs in Java, C++, Python, web technologies, and
emerging fields like Blockchain.
• Develops curriculum aligned with industry needs and updates content regularly.
• Conducts coding challenges, projects, and assessments to monitor learner progress.
Technical Support Department
• Provides guidance to learners during practical sessions and project work.
• Resolves technical issues related to software installation, code execution, and learning platforms.
• Assists trainers in setting up development environments and tools.
Placement and Career Services Department
• Connects learners with potential employers through placement drives and interview scheduling.
• Conducts mock interviews, resume-building sessions, and soft skills workshops.
• Maintains partnerships with companies for internship and job opportunities.
Research and Curriculum Innovation Department
• Studies emerging technologies and incorporates them into training modules.
• Innovates teaching methods to enhance learner engagement.
• Collaborates with industry experts to maintain relevance of content.
Administration and Operations Department
• Manages day-to-day operations, scheduling, and resource allocation.
• Handles enrolment processes, fee management, and documentation.
• Ensures smooth coordination between trainers, learners, and support staff.
Organization chart of the company
Brief description of the work done
The "Master DSA with Java and C++" course at W3Grads focuses on building a comprehensive
understanding of Data Structures and Algorithms, which form the backbone of efficient software
development. Mastery of DSA is essential for solving complex computational problems,
optimizing performance, and writing scalable applications. This course blends theoretical
concepts with practical coding exercises, enabling learners to not only understand algorithms but
also implement them effectively in both Java and C++. Through structured lessons, coding
challenges, and hands-on projects, participants gain the ability to design, analyse, and optimize
algorithms for real-world applications.
KEY AREAS COVERED:
Introduction to Data Structures and Algorithms (DSA):
Learners are introduced to fundamental concepts of DSA, including data types, algorithm
analysis, time and space complexity, and problem-solving approaches. Topics such as asymptotic
notation, best/worst/average cases, and the role of DSA in software development are also covered.
Basics of Java and C++ for DSA Implementation:
The course starts with core syntax, data types, control structures, and OOP concepts in both Java
and C++, enabling learners to implement algorithms efficiently in either language.
Linear Data Structures:
Covers arrays, linked lists (singly, doubly, and circular), stacks, and queues. Learners practice
insertion, deletion, traversal, and searching operations with both iterative and recursive
approaches.
Non-linear Data Structures:
Introduces trees (binary trees, BSTs, AVL trees, heaps) and graphs (directed, undirected, weighted,
unweighted), along with traversal algorithms like BFS and DFS.
Algorithmic Techniques:
Explores searching (linear, binary, interpolation) and sorting (bubble, selection, insertion, merge,
quick, heap sort) techniques, including complexity analysis and use cases.
Recursion and Dynamic Programming:
Teaches problem-solving using recursion and optimizes solutions with dynamic programming
approaches like memoization and tabulation.
Hashing and Advanced Data Structures:
Covers hash tables, hash functions, collision resolution techniques, and advanced structures like
tries, segment trees, and disjoint sets.
Problem-Solving Strategies:
Focuses on greedy algorithms, backtracking, divide-and-conquer, and graph algorithms
(Dijkstra’s, Floyd-Warshall, Kruskal’s, Prim’s).
Hands-On Projects and Coding Challenges:
Learners solve real-world problems, competitive programming exercises, and implement
miniprojects to strengthen practical skills.
Final Assessment and Certification:
The course concludes with coding tests and theoretical assessments to evaluate algorithm design
skills and programming proficiency in Java and C++. Successful completion leads to certification,
validating the learner’s expertise in DSA.
PROJECT DETAILS:
Railway Waiting Queue Management System:
Technology Used:
1. Programming Language: Java – for developing the console-based application.
2. Data Structure: Queue (FIFO) – to manage passenger waiting list in order.
3. Storage: File handling – to save and retrieve passenger and seat details.
4. IDE: IntelliJ IDEA / Eclipse / NetBeans – for coding and execution.
5. Operating System: Windows – used for development and testing.
CODE:
[Link]
// Source code is decompiled from a .class file using FernFlower decompiler.
import [Link]; import
[Link];
import [Link];
public class Main {
private static final int TOTAL_SEATS = 5;
private static final RailwayQueueManager manager = new RailwayQueueManager(5);
private static final Scanner sc;
private static final String RESET = "\u001b[0m";
private static final String GREEN = "\u001b[32m";
private static final String RED = "\u001b[31m"; private
static final String CYAN = "\u001b[36m";
private static final String YELLOW = "\u001b[33m";
public Main() {
}
public static void main(String[] var0) {
while(true) {
[Link]("\u001b[36m\n--- Railway Waiting Queue Management System ---\u001b[0m");
[Link]("Available Seats: \u001b[32m" + [Link]() + "\u001b[0m / 5");
[Link]("Waiting List: \u001b[33m" + [Link]() + "\u001b[0m");
[Link]("1. Book Seat");
[Link]("2. Cancel Booking");
[Link]("3. Show Confirmed Passengers");
[Link]("4. Show Waiting List");
[Link]("5. Search Passenger");
[Link]("6. Edit Passenger Details");
[Link]("7. Export Passenger List to CSV");
[Link]("8. Exit");
[Link]("Enter choice: ");
int var1 = getIntInput();
switch (var1) { case 1:
bookSeat();
break;
case 2:
cancelBooking();
break;
case 3:
showConfirmed();
break; case 4:
showWaiting();
break;
case 5:
searchPassenger();
break;
case 6:
editPassenger();
break;
case 7:
exportCSV();
break;
case 8:
[Link]("Exiting...");
return; default:
[Link]("\u001b[31mInvalid choice.\u001b[0m");
}
}
}
private static int getIntInput() {
while(true) { try {
int var0 = [Link]([Link]());
return var0;
} catch (Exception var1) {
[Link]("\u001b[31mInvalid input. Enter a number: \u001b[0m");
}
}
}
private static void bookSeat() {
[Link]("Enter Name: "); String
var0 = [Link]().trim();
if ([Link]()) {
[Link]("\u001b[31mName cannot be empty.\u001b[0m");
} else {
[Link]("Enter Age: ");
int var1 = getIntInput(); if (var1
>= 0 && var1 <= 120) {
[Link]("Enter Gender: ");
String var2 = [Link]().trim();
if ([Link]()) {
[Link]("\u001b[31mGender cannot be empty.\u001b[0m");
} else {
[Link]("Enter Contact Number: ");
String var3 = [Link]().trim(); if
() {
[Link]("\u001b[31mInvalid contact number.\u001b[0m");
} else {
Passenger var4 = new Passenger(var0, var1, var2, var3, "");
boolean var5 = [Link](var4); if (var5) {
[Link]("\u001b[32mSeat booked successfully! Status: Confirmed. Ticket: " + [Link]() + "\u001b[0m");
} else {
[Link]("\u001b[33mAll seats full. Added to waiting list. Status: Waiting. Ticket: " + [Link]() + "\u001b[0m");
}
}
}
} else {
[Link]("\u001b[31mInvalid age.\u001b[0m");
}
}
}
private static void cancelBooking() {
[Link]("Enter Contact Number to cancel: ");
String var0 = [Link]().trim(); boolean var1 =
[Link](var0); if (var1) {
[Link]("\u001b[32mBooking cancelled and waiting list updated if applicable.\u001b[0m");
} else {
[Link]("\u001b[31mNo confirmed booking found with that contact number.\u001b[0m");
}
private static void showConfirmed() {
List var0 = [Link]();
[Link]("\u001b[36m\n--- Confirmed Passengers ---\u001b[0m");
if ([Link]()) {
[Link]("No confirmed passengers.");
} else {
[Link]("%-8s %-15s %-5s %-8s %-15s %-10s\n", "Ticket", "Name", "Age", "Gender", "Contact", "Status");
Iterator var1 = [Link]();
while([Link]()) {
Passenger var2 = (Passenger)[Link]();
[Link](var2);
}
}
private static void showWaiting() {
List var0 = [Link]();
[Link]("\u001b[33m\n--- Waiting List ---\u001b[0m");
if ([Link]()) {
[Link]("No passengers in waiting list.");
} else {
[Link]("%-8s %-15s %-5s %-8s %-15s %-10s\n", "Ticket", "Name", "Age", "Gender", "Contact", "Status");
Iterator var1 = [Link]();
while([Link]()) {
Passenger var2 = (Passenger)[Link]();
[Link](var2);
}
}
private static void searchPassenger() {
[Link]("Search by: 1. Ticket Number 2. Name");
int var0 = getIntInput(); if (var0 == 1) {
[Link]("Enter Ticket Number: ");
int var1 = getIntInput();
Passenger var2 = [Link](var1);
if (var2 != null) {
[Link]("%-8s %-15s %-5s %-8s %-15s %-10s\n", "Ticket", "Name", "Age", "Gender", "Contact", "Status");
[Link](var2);
} else {
[Link]("\u001b[31mNo passenger found with that ticket number.\u001b[0m");
}
} else if (var0 == 2) {
[Link]("Enter Name: ");
String var5 = [Link]().trim();
List var6 = [Link](var5);
if (![Link]()) {
[Link]("%-8s %-15s %-5s %-8s %-15s %-10s\n", "Ticket", "Name", "Age", "Gender", "Contact", "Status");
Iterator var3 = [Link]();
while([Link]()) {
Passenger var4 = (Passenger)[Link]();
[Link](var4);
}
} else {
[Link]("\u001b[31mNo passenger found with that name.\u001b[0m");
}
} else {
[Link]("\u001b[31mInvalid option.\u001b[0m");
}
private static void editPassenger() {
[Link]("Enter Ticket Number to edit: ");
int var0 = getIntInput();
Passenger var1 = [Link](var0);
if (var1 == null) {
[Link]("\u001b[31mNo passenger found with that ticket number.\u001b[0m");
} else {
[Link]("Enter New Name (leave blank to keep current): ");
String var2 = [Link]().trim();
if ([Link]()) {
var2 = [Link]();
}
[Link]("Enter New Age (or -1 to keep current): ");
int var3 = getIntInput(); if (var3 < 0 || var3 > 120) {
var3 = [Link]();
}
[Link]("Enter New Gender (leave blank to keep current): ");
String var4 = [Link]().trim();
if ([Link]()) {
var4 = [Link]();
}
[Link]("Enter New Contact (leave blank to keep current): ");
String var5 = [Link]().trim();
if ([Link]()) {
var5 = [Link]();
}
boolean var6 = [Link](var0, var2, var3, var4, var5); if
(var6) {
[Link]("\u001b[32mPassenger details updated.\u001b[0m");
} else {
[Link]("\u001b[31mFailed to update passenger.\u001b[0m");
}
}}
private static void exportCSV() {
[Link]("Enter filename to export (e.g., [Link]): ");
String var0 = [Link]().trim();
try {
[Link](var0);
[Link]("\u001b[32mExported to " + var0 + "\u001b[0m");
} catch (Exception var2) {
[Link]("\u001b[31mFailed to export: " + [Link]() + "\u001b[0m");
}
static {
sc = new Scanner([Link]);
}
}
[Link]
// Source code is decompiled from a .class file using FernFlower decompiler.
import [Link];
public class Passenger {
private static final AtomicInteger ticketCounter = new AtomicInteger(1000);
private final int ticketNumber; private String name; private int age;
private String gender; private String contact;
private String status;
public Passenger(String var1, int var2, String var3, String var4, String var5) {
[Link] = [Link]();
[Link] = var1;
[Link] = var2;
[Link] = var3;
[Link] = var4;
[Link] = var5;
}
public int getTicketNumber() {
return [Link];
}
public String getName() {
return [Link];
}
public int getAge() {
return [Link];
}
public String getGender() {
return [Link];
}
public String getContact() {
return [Link];
}
public String getStatus() {
return [Link];
}
public void setStatus(String var1) {
[Link] = var1;
}
public void setName(String var1) {
[Link] = var1;
}
public void setAge(int var1) {
[Link] = var1;
}
public void setGender(String var1) {
[Link] = var1;
}
public void setContact(String var1) {
[Link] = var1;
}
public String toCSV() {
return [Link] + "," + [Link] + "," + [Link] + "," + [Link] + "," + [Link] + "," + [Link];
}
public String toString() {
return [Link]("%-8d %-15s %-5d %-8s %-15s %-10s", [Link], [Link], [Link], [Link], [Link], [Link]);
}
}
[Link]
import [Link].*;
public class RailwayQueueManager {
private final int totalSeats;
private final List<Passenger> confirmedList;
private final Queue<Passenger> waitingQueue;
public RailwayQueueManager(int totalSeats) {
[Link] = totalSeats;
[Link] = new ArrayList<>();
[Link] = new LinkedList<>();
}
public boolean bookSeat(Passenger passenger) {
if ([Link]() < totalSeats) {
[Link]("Confirmed");
[Link](passenger);
return true;
} else {
[Link]("Waiting");
[Link](passenger);
return false;
}
}
public boolean cancelBooking(String contact) {
Iterator<Passenger> iterator = [Link]();
while ([Link]()) {
Passenger p = [Link](); if
([Link]().equals(contact)) {
[Link]();
if (![Link]()) {
Passenger next = [Link]();
[Link]("Confirmed");
[Link](next);
}
return true;
}
}
return false;
}
public Passenger searchByTicket(int ticketNumber) {
for (Passenger p : confirmedList) {
if ([Link]() == ticketNumber)
return p;
}
for (Passenger p : waitingQueue) {
if ([Link]() == ticketNumber)
return p;
}
return null;
}
public List<Passenger> searchByName(String name) {
List<Passenger> result = new ArrayList<>(); for
(Passenger p : confirmedList) {
if ([Link]().equalsIgnoreCase(name))
[Link](p);
}
for (Passenger p : waitingQueue) {
if ([Link]().equalsIgnoreCase(name))
[Link](p);
}
return result;
}
public boolean editPassenger(int ticketNumber, String name, int age, String gender, String contact) {
Passenger p = searchByTicket(ticketNumber);
if (p != null) {
[Link](name);
[Link](age);
[Link](gender);
[Link](contact);
return true;
}
return false;
}
public int getAvailableSeats() {
return totalSeats - [Link]();
}
public int getWaitingCount() {
return [Link]();
}
public List<Passenger> getConfirmedList() {
return [Link](confirmedList);
}
public List<Passenger> getWaitingList() {
return new ArrayList<>(waitingQueue);
}
public void exportToCSV(String filename) throws Exception {
List<Passenger> all = new ArrayList<>();
[Link](confirmedList); [Link](waitingQueue);
[Link] fw = new [Link](filename);
[Link]("Ticket,Name,Age,Gender,Contact,Status\n");
for (Passenger p : all) {
[Link]([Link]() + "\n");
}
[Link]();
}
}
[Link]
// Utility class for any future helper methods (optional, for extensibility) public
class Utils {
// Add static helper methods here if needed
}
OUTPUT:
OUTCOME:
By the end of the course, learners gain a solid foundation in Data Structures and Algorithms,
enabling them to write optimized, scalable, and efficient code in both Java and C++. They acquire
skills applicable to various roles such as Software Developer, Competitive Programmer, Backend
Engineer, and Technical Interview Candidate. Graduates are equipped to analyze problems, design
appropriate algorithms, and implement them effectively in real-world scenarios.
CONCLUSION
The "Master DSA with Java and C++" course at W3Grads has been a
transformative learning experience, equipping participants with a strong foundation
in Data Structures and Algorithms and the ability to implement them efficiently in
two widely used programming languages. Through a balanced blend of theoretical
concepts, practical coding exercises, and real-world projects, the course has
enhanced problem-solving skills, analytical thinking, and programming efficiency.
Learners have gained the capability to design optimized algorithms, evaluate their
performance, and apply them to complex computational challenges. Beyond
technical proficiency, the program has fostered confidence, discipline, and
adaptability—essential qualities for success in competitive programming, technical
interviews, and professional software development. This course stands as a
significant milestone in preparing learners for future growth in the ever-evolving
field of computer science and technology.
REFERENCE
W3Grads – Master DSA with Java and C++ Course Curriculum. Retrieved from:
[Link]
Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd
ed.). MIT Press.
Sedgewick, R., & Wayne, K. (2011). Algorithms (4th ed.). Addison-Wesley.
Malik, D. S. (2010). Data Structures Using C++. Cengage Learning.
Horstmann, C. S., & Cornell, G. (2015). Core Java Volume I – Fundamentals (10th ed.). Prentice Hall.
GeeksforGeeks – Data Structures and Algorithms Tutorials. Retrieved from:
[Link]
HackerRank – Algorithms and Data Structures Practice Problems. Retrieved from:
[Link]
LeetCode – Programming Challenges and Interview Preparation. Retrieved from:
[Link]
Stroustrup, B. (2013). The C++ Programming Language (4th ed.). Addison-Wesley.
Java Documentation – Oracle. Retrieved from: [Link]