Skip to content

10 C++ projects implementing fundamental Data Structures (Linked Lists, BST, Heaps, Stacks, Queues, Graphs, Hash Maps) and Algorithms (BFS, DFS, 6 Sorting methods).

License

Notifications You must be signed in to change notification settings

ASAD2204/DSA-Projects-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Data Structures & Algorithms Projects Portfolio

A comprehensive collection of 10 beginner-to-intermediate DSA projects implemented in C++, demonstrating practical applications of fundamental data structures and algorithms.

Language License Projects

πŸ“š Table of Contents


🌟 Overview

This repository contains 10 complete DSA projects built from scratch in C++. Each project focuses on different data structures and algorithms, providing hands-on experience with:

  • Data Structures: Linked Lists, Binary Search Trees, Heaps, Stacks, Queues, Graphs, Hash Maps
  • Algorithms: Sorting (6 algorithms), Searching, Graph Traversal (BFS/DFS), Heapify operations
  • Real-world Applications: Student management, contact books, task schedulers, maze solvers, and more

All projects feature:

  • βœ… Menu-driven user interfaces
  • βœ… Comprehensive comments and documentation
  • βœ… Error handling and input validation
  • βœ… File I/O for data persistence
  • βœ… Clean, readable code structure

πŸš€ Projects

1. Student Management System

Data Structure: Singly Linked List
Features:

  • CRUD operations for student records
  • Search by roll number, name, or department
  • Sort by roll number, name, or GPA
  • CSV file export/import
  • Statistical analysis (average GPA, top performers)

Key Concepts: Linked List operations, File I/O, Sorting algorithms

View Project β†’


2. Contact Book (Phonebook)

Data Structure: Binary Search Tree (BST)
Features:

  • Add/delete contacts (auto-sorted alphabetically)
  • Search by name (exact or prefix matching)
  • Display in alphabetical order
  • Export to CSV
  • Categorize contacts (Family, Friends, Work, etc.)

Key Concepts: BST operations, Tree traversal (Inorder), Prefix search

View Project β†’


3. ToDo List with Priority Management

Data Structure: Min Heap (Priority Queue)
Features:

  • Add tasks with priority levels (High/Medium/Low)
  • Automatic priority-based sorting
  • Mark tasks as complete
  • View tasks by priority or status
  • Deadline tracking

Key Concepts: Heap operations, Heapify, Priority Queue implementation

View Project β†’


4. Parentheses & Bracket Validator

Data Structure: Stack
Features:

  • Validate balanced parentheses/brackets/braces
  • Support for ( ) { } [ ] < >
  • Error detection with position reporting
  • Detailed error messages (missing, extra, or mismatched brackets)
  • Built-in test cases

Key Concepts: Stack operations, Expression validation, String parsing

View Project β†’


5. Text Editor with Undo/Redo

Data Structure: Two Stacks (Undo + Redo)
Features:

  • Insert/delete text at any position
  • Unlimited undo/redo functionality
  • Copy/paste with clipboard
  • Display with line numbers
  • Character and word count

Key Concepts: Stack-based state management, Undo/Redo pattern

View Project β†’


6. Playlist Manager

Data Structure: Queue + Stack
Features:

  • Play queue with FIFO behavior
  • Recently played history (Stack)
  • Shuffle mode with randomization
  • Repeat mode
  • Song library management
  • Next/Previous navigation

Key Concepts: Queue operations, Combining multiple data structures

View Project β†’


7. Library Book Management System

Data Structure: BST (Catalog) + Priority Queue (Issue Requests)
Features:

  • Book catalog with search by ID/title
  • Issue/return books with copy tracking
  • Priority-based waiting list
  • Auto-issue when books are returned
  • Availability status

Key Concepts: Combining BST with Priority Queue, Inventory management

View Project β†’


8. Maze Solver & Generator

Data Structure: Graph (Adjacency Matrix), BFS, DFS
Features:

  • Random maze generation
  • Solve using BFS (shortest path)
  • Solve using DFS (depth-first exploration)
  • Path visualization
  • Custom maze input
  • Compare algorithm performance

Key Concepts: Graph representation, BFS/DFS traversal, Pathfinding

View Project β†’


9. Sorting Algorithm Visualizer

Data Structure: Arrays
Features:

  • 6 Sorting Algorithms:
    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
    • Heap Sort
  • Step-by-step visualization
  • Performance metrics (comparisons, swaps)
  • Random array generation
  • Algorithm comparison

Key Concepts: All major sorting algorithms, Time complexity analysis

View Project β†’


10. Word Frequency Counter & Analyzer

Data Structure: Hash Map (unordered_map) + Priority Queue
Features:

  • Word frequency counting
  • Top K most/least frequent words
  • Text file loading
  • Search with percentage
  • Statistical analysis
  • Case-insensitive processing

Key Concepts: Hash Maps, Top-K problems, Text processing

View Project β†’


πŸ› οΈ Technologies Used

  • Language: C++11
  • Compiler: g++ (GCC/MinGW)
  • Standard Libraries:
    • <iostream> - Input/Output
    • <fstream> - File handling
    • <string> - String operations
    • <vector> - Dynamic arrays
    • <queue> - Queue/Priority Queue
    • <stack> - Stack operations
    • <unordered_map> - Hash Map
    • <algorithm> - Sorting/Searching

πŸ’» Installation & Setup

Prerequisites

  • C++ Compiler: GCC/g++ or MinGW (Windows) or Clang (macOS/Linux)
  • C++11 or higher

Windows (MinGW)

# Install MinGW from: https://sourceforge.net/projects/mingw/
# Add to PATH: C:\MinGW\bin

# Verify installation
g++ --version

Linux

# Install g++
sudo apt-get update
sudo apt-get install g++

# Verify installation
g++ --version

macOS

# Install Xcode Command Line Tools
xcode-select --install

# Verify installation
g++ --version

▢️ How to Run

Clone the Repository

git clone https://github.com/ASAD2204/DSA_Projects.git
cd DSA_Projects

Compile and Run Individual Projects

Windows (PowerShell/CMD)

# Navigate to project folder
cd Project_01_Student_Management

# Compile
g++ -std=c++11 main.cpp -o student_manager.exe

# Run
student_manager.exe

Linux/macOS

# Navigate to project folder
cd Project_01_Student_Management

# Compile
g++ -std=c++11 main.cpp -o student_manager

# Run
./student_manager

Compile All Projects (Batch Script)

Windows (PowerShell):

# Save as compile_all.ps1
$projects = @(
    "Project_01_Student_Management",
    "Project_02_Contact_Book",
    "Project_03_ToDo_Priority",
    "Project_04_Parentheses_Checker",
    "Project_05_Text_Editor",
    "Project_06_Playlist_Manager",
    "Project_07_Library_Management",
    "Project_08_Maze_Solver",
    "Project_09_Sorting_Visualizer",
    "Project_10_Word_Analyzer"
)

foreach ($project in $projects) {
    Write-Host "Compiling $project..." -ForegroundColor Green
    cd $project
    g++ -std=c++11 main.cpp -o app.exe
    cd ..
}

Write-Host "All projects compiled successfully!" -ForegroundColor Cyan

Linux/macOS (Bash):

#!/bin/bash
# Save as compile_all.sh

projects=(
    "Project_01_Student_Management"
    "Project_02_Contact_Book"
    "Project_03_ToDo_Priority"
    "Project_04_Parentheses_Checker"
    "Project_05_Text_Editor"
    "Project_06_Playlist_Manager"
    "Project_07_Library_Management"
    "Project_08_Maze_Solver"
    "Project_09_Sorting_Visualizer"
    "Project_10_Word_Analyzer"
)

for project in "${projects[@]}"; do
    echo "Compiling $project..."
    cd "$project"
    g++ -std=c++11 main.cpp -o app
    cd ..
done

echo "All projects compiled successfully!"

πŸ“‚ Project Structure

DSA_Projects/
β”‚
β”œβ”€β”€ README.md                           # This file
β”œβ”€β”€ PROJECT_SUMMARY.md                  # Detailed project documentation
β”œβ”€β”€ LICENSE                             # MIT License
β”œβ”€β”€ CONTRIBUTING.md                     # Contribution guidelines
β”œβ”€β”€ .gitignore                          # Git ignore rules
β”‚
β”œβ”€β”€ dsa.h                               # Comprehensive DSA library
β”œβ”€β”€ test_dsa.cpp                        # Test suite for dsa.h
β”‚
β”œβ”€β”€ Project_01_Student_Management/
β”‚   β”œβ”€β”€ Student.h
β”‚   β”œβ”€β”€ StudentManager.h
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_02_Contact_Book/
β”‚   β”œβ”€β”€ Contact.h
β”‚   β”œβ”€β”€ ContactBook.h
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_03_ToDo_Priority/
β”‚   β”œβ”€β”€ Task.h
β”‚   β”œβ”€β”€ ToDoManager.h
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_04_Parentheses_Checker/
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_05_Text_Editor/
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_06_Playlist_Manager/
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_07_Library_Management/
β”‚   β”œβ”€β”€ Book.h
β”‚   β”œβ”€β”€ LibraryCatalog.h
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_08_Maze_Solver/
β”‚   └── main.cpp
β”‚
β”œβ”€β”€ Project_09_Sorting_Visualizer/
β”‚   └── main.cpp
β”‚
└── Project_10_Word_Analyzer/
    └── main.cpp

πŸ“Š Data Structures & Algorithms Coverage

Data Structures Implemented

Data Structure Projects
Singly Linked List #1
Binary Search Tree #2, #7
Min Heap #3, #7
Max Heap #9
Stack #4, #5, #6
Queue #6
Priority Queue #3, #7, #10
Graph (Adjacency Matrix) #8
Hash Map #10
Arrays #9

Algorithms Implemented

Algorithm Time Complexity Projects
Bubble Sort O(nΒ²) #1, #9
Selection Sort O(nΒ²) #9
Insertion Sort O(nΒ²) #9
Merge Sort O(n log n) #9
Quick Sort O(n log n) avg #9
Heap Sort O(n log n) #9
Binary Search O(log n) #2
BFS O(V + E) #8
DFS O(V + E) #8
Heapify O(log n) #3, #9

🎯 Learning Outcomes

By exploring these projects, you will gain:

  1. Data Structure Mastery

    • Understanding when to use each data structure
    • Implementation from scratch
    • Trade-offs and performance characteristics
  2. Algorithm Design

    • Sorting and searching techniques
    • Graph traversal algorithms
    • Problem-solving patterns
  3. Software Engineering

    • Clean code principles
    • Modular design
    • File I/O and data persistence
    • Error handling
  4. Interview Preparation

    • Common DSA interview questions
    • Time/space complexity analysis
    • Real-world application of concepts

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on how to contribute to this project.


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Asad

  • GitHub: @ASAD2204
  • BS IT (4th Semester) PUGC

🌟 Acknowledgments

  • Inspired by classic DSA problems and interview questions
  • Built for educational purposes and portfolio development
  • All implementations are original and created from scratch

πŸ“ˆ Project Stats

  • Total Projects: 10
  • Total Lines of Code: ~3000+
  • Data Structures Covered: 10+
  • Algorithms Implemented: 15+
  • Time Investment: 40+ hours

πŸ”— Quick Links


⭐ If you found this helpful, please star the repository!

Happy Coding! πŸš€

About

10 C++ projects implementing fundamental Data Structures (Linked Lists, BST, Heaps, Stacks, Queues, Graphs, Hash Maps) and Algorithms (BFS, DFS, 6 Sorting methods).

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published