Skip to content

Repository files navigation

🧠 Data Structures & Algorithms in C++

C++ DSA University Problem Solving

🚀 Data Structures & Algorithms

A comprehensive C++ journey through Data Structures, Algorithms, Problem Solving, and Algorithm Design.

From basic arrays and linked lists to trees, AVL trees, graphs, BFS, and minimum spanning tree concepts.


📖 About This Repository

This repository contains my complete Data Structures & Algorithms practice and coursework in C++, developed throughout my university semester.

Rather than limiting the work to classroom exercises, I used this repository as a practical space to implement, experiment with, revisit, and extend different data structures and algorithms.

The repository includes:

  • 📚 University lecture material
  • 💻 C++ implementations
  • 🧩 DSA tasks and assignments
  • 🔬 Additional experiments and practice code
  • 🏗️ Practical DSA projects
  • 📊 Searching and sorting algorithms
  • 🌳 Tree and AVL tree concepts
  • 🕸️ Graph algorithms and BFS
  • 🌐 Minimum spanning tree concepts
  • 🏆 Algorithm design material
  • 🎓 Course certificates and academic resources

This repository represents my hands-on progression through fundamental and advanced DSA concepts.


🗺️ My DSA Learning Journey

                    🧠 DATA STRUCTURES & ALGORITHMS
                               │
          ┌────────────────────┼────────────────────┐
          │                    │                    │
          ▼                    ▼                    ▼
      LINEAR DS           ALGORITHMS           NON-LINEAR DS
          │                    │                    │
     ┌────┼────┐         ┌─────┼─────┐        ┌────┴────┐
     │    │    │         │     │     │        │         │
   Array Stack Queue   Search Sort Recursion  Trees    Graphs
     │    │    │         │     │              │         │
     └────┴────┘         │     │           AVL Trees   BFS
          │              │     │                        │
     Linked Lists        └─────┘                        │
          │                                             │
   ┌──────┼──────┐                              MST Concepts
   │      │      │
Singly Doubly Circular

🧩 Core Topics Covered

1. 🔢 Arrays

Fundamental array-based problem solving and manipulation.

Topics include:

  • Array traversal
  • Minimum element finding
  • Minimum number problems
  • Array-based recursion
  • Basic problem-solving techniques

2. 🔗 Linked Lists

A major part of this repository is dedicated to implementing and understanding linked lists.

Covered concepts

  • Singly Linked Lists
  • Doubly Linked Lists
  • Circular Linked Lists
  • Node creation
  • Insertion
  • Deletion
  • Traversal
  • Middle-node deletion
  • Insertion at beginning
  • Insertion at end
  • General insertion operations

Practical Work

The repository also contains linked-list-based contact management implementations, providing a practical application of linked-list concepts.


3. 📚 Stacks

Stack implementations and applications using both custom implementations and STL.

Concepts

  • Stack creation
  • Push
  • Pop
  • Peek / Top
  • Stack traversal
  • Stack operations
  • STL Stack

Applications

A particularly important application covered here is expression conversion:

Infix
  │
  ├──────────────► Postfix
  │
  └──────────────► Prefix

Examples of concepts practiced:

  • Infix → Postfix
  • Infix → Prefix
  • Operator precedence
  • Expression processing
  • Stack-based algorithms

4. 🚶 Queues

Queue implementations and problem-solving exercises.

Concepts

  • Basic Queue
  • Enqueue
  • Dequeue
  • Queue traversal
  • Queue operations
  • STL Queue
  • Queue merging
  • Queue-based problems

The repository also contains several DSA tasks specifically focused on queue operations.


5. 🔄 Recursion

Recursive problem-solving is explored through practical C++ programs.

Examples include:

  • Array operations using recursion
  • Recursive problem solving
  • Recursive mathematical operations
  • Understanding function call stacks

Recursion also connects naturally with more advanced algorithms and tree traversal concepts.


6. 🔍 Searching Algorithms

Searching algorithms are implemented from scratch.

Covered

  • Linear Search
  • Binary Search
Unsorted / General Data
          │
          ▼
     Linear Search
          │
          │
          ▼
Sorted Data
          │
          ▼
     Binary Search

The implementations demonstrate the difference between straightforward sequential searching and more efficient divide-and-conquer searching.


7. 📊 Sorting Algorithms

Multiple fundamental sorting algorithms are implemented and practiced.

Covered

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort concepts

The repository focuses on understanding how sorting algorithms work internally rather than simply calling library functions.


8. 🌳 Trees & AVL Trees

The repository moves beyond linear data structures into hierarchical structures.

Topics covered

  • Trees
  • Tree concepts
  • Tree representations
  • Tree traversal concepts
  • AVL Trees
  • Balanced trees

The lecture material also includes dedicated content for Trees and AVL Trees, reflecting the progression from basic structures toward balanced search trees.


9. 🕸️ Graphs & Breadth-First Search

Graph theory introduces a major transition from hierarchical structures to network-based structures.

Covered concepts

  • Graph fundamentals
  • Graph representation
  • Graph traversal
  • Breadth-First Search (BFS)
        A
       / \
      B   C
     / \   \
    D   E   F

BFS:

A → B → C → D → E → F

The repository contains dedicated lecture material for graph concepts and Breadth-First Search.


10. 🌐 Minimum Spanning Trees & Algorithm Design

The repository also touches higher-level algorithmic concepts such as:

  • Minimum Spanning Trees
  • Graph-based optimization
  • Algorithm design
  • Problem decomposition
  • Moving from algorithm design toward working prototypes

The repository includes academic material covering Minimum Spanning Trees and an Algorithm Design to Working Prototype certificate.


🏗️ Practical Projects

This repository isn't limited to individual algorithms.

It also contains practical DSA applications that combine multiple concepts.

📚 Old Book Corner

A complete C++ console-based book management and exchange system.

The project demonstrates how DSA concepts can be combined into a real-world application.

Features

  • 👨‍💼 Admin menu
  • 👤 User menu
  • ➕ Add books
  • 🗑️ Remove books
  • ✏️ Update books
  • 🔍 Search books
  • 📚 Display books
  • 🛒 Buy books
  • 💰 Sell books
  • 🔄 Exchange books

DSA Used

  • Singly Linked List
  • Stack
  • Vector
  • Pointers
  • Dynamic Memory Allocation
  • Searching
  • Traversal

🧪 Practice & Experimental Work

The extracode section represents additional experimentation beyond the main coursework.

It contains implementations and exercises involving:

  • Linked Lists
  • Queue
  • Stack
  • Expression conversion
  • Recursion
  • Prime numbers
  • Array operations
  • Node manipulation
  • STL containers
  • C++ programming experiments

This section reflects the part of the learning process where concepts were explored outside the primary assignments.


📂 Repository Organization

The repository is organized around major DSA topics and university coursework.

📦 Data Structures & Algorithms
│
├── 🔢 Arrays
│
├── 🔗 LinkedLists
│
├── 📚 stack
│
├── 🚶 Queue
│
├── 🔍 searching
│
├── 📊 sorting
│
├── 🔄 extracode
│
├── 🧩 dsa task 4
│
├── 🏗️ Project
│
├── 📚 Lecture Materials
│   ├── Trees
│   ├── AVL Trees
│   ├── BFS
│   ├── Graphs
│   └── Minimum Spanning Trees
│
├── 📜 certificates
│
└── 📄 Course / Assignment Materials

The repository structure intentionally reflects the learning process throughout the semester rather than forcing every implementation into a rigid software-project architecture.


🛠️ Technologies Used

Primary Language

C++

Development Environment

  • Visual Studio Code
  • GCC / G++
  • Windows

🧠 Concepts Practiced

Category Concepts
🔢 Linear Structures Arrays, Linked Lists
📚 ADTs Stack, Queue
🌳 Hierarchical Structures Trees, AVL Trees
🕸️ Network Structures Graphs
🔍 Searching Linear Search, Binary Search
📊 Sorting Bubble, Selection, Insertion, Merge, Quick
🔄 Problem Solving Recursion
🧩 Algorithms BFS, MST concepts
💾 Memory Pointers, Dynamic Allocation
🏗️ Programming Structures, Classes, STL

⏱️ Algorithmic Thinking

One of the most important outcomes of this coursework was learning to think beyond:

"How do I write the code?"

and instead ask:

"What data structure and algorithm are appropriate for this problem?"

For example:

Problem
   │
   ▼
Understand the Data
   │
   ▼
Choose a Data Structure
   │
   ▼
Choose an Algorithm
   │
   ▼
Implement
   │
   ▼
Test
   │
   ▼
Analyze Complexity
   │
   ▼
Improve

This progression forms the foundation of efficient problem solving in computer science.


📈 Complexity Awareness

The implementations were also used to understand algorithmic efficiency.

Examples:

Algorithm / Operation Typical Complexity
Array Access O(1)
Linear Search O(n)
Binary Search O(log n)
Linked List Traversal O(n)
Linked List Insert at Head O(1)
Bubble Sort O(n²)
Selection Sort O(n²)
Insertion Sort O(n²)
Merge Sort O(n log n)
BFS O(V + E)

Complexity depends on the specific operation, implementation, and input conditions.


🎓 University Coursework

This repository contains material developed throughout my university Data Structures & Algorithms course.

It includes:

  • 📝 Assignments
  • 🧪 Practical tasks
  • 💻 Implementations
  • 📊 Algorithm exercises
  • 📚 Lecture resources
  • 🏗️ Semester project
  • 🏆 Additional learning material

The repository therefore serves both as a course archive and as a record of my practical DSA learning journey.


🏆 Beyond the Basic Coursework

The goal was not simply to complete the required assignments.

I explored additional implementations and connected different concepts together.

The progression can be summarized as:

Basics
  │
  ▼
Arrays
  │
  ▼
Linked Lists
  │
  ▼
Stacks & Queues
  │
  ▼
Searching & Sorting
  │
  ▼
Recursion
  │
  ▼
Trees
  │
  ▼
AVL Trees
  │
  ▼
Graphs
  │
  ▼
BFS
  │
  ▼
Minimum Spanning Trees
  │
  ▼
🏗️ Practical DSA Projects

💡 What I Learned

This repository helped me build a stronger understanding of:

  • 🧠 Algorithmic thinking
  • 🧩 Data structure selection
  • 🔗 Pointer-based structures
  • 💾 Dynamic memory management
  • 🔍 Searching strategies
  • 📊 Sorting techniques
  • 🔄 Recursive problem solving
  • 🌳 Hierarchical data
  • 🕸️ Graph traversal
  • ⚡ Algorithm efficiency
  • 🏗️ Combining multiple structures in real applications
  • 💻 Writing C++ implementations from scratch

Most importantly, it helped transform DSA from a theoretical university subject into something I could actually implement and experiment with.


📜 Certificate & Academic Material

The repository also contains supporting academic resources and certificates related to algorithm design and coursework.

These materials document the broader learning journey alongside the implementations.


🚀 Future Improvements

This repository represents my university-era DSA work, but it can continue to evolve.

Possible future additions:

  • ⚡ More optimized implementations
  • 🧪 Unit testing
  • 📊 Complexity comparison experiments
  • 🧠 Advanced graph algorithms
  • 🌳 Binary Search Trees
  • 🔴 Red-Black Trees
  • 🕸️ Dijkstra's Algorithm
  • 🌐 Kruskal's Algorithm
  • 🌐 Prim's Algorithm
  • 🧩 Dynamic Programming
  • 💻 Competitive Programming problems
  • 🏆 LeetCode / Codeforces implementations
  • 📈 Algorithm benchmarking and visualization

⭐ Repository Highlights

╔══════════════════════════════════════════════╗
║          🧠 DSA IN C++ — HIGHLIGHTS          ║
╠══════════════════════════════════════════════╣
║                                              ║
║  🔢 Arrays                                  ║
║  🔗 Linked Lists                             ║
║  📚 Stacks                                  ║
║  🚶 Queues                                  ║
║  🔄 Recursion                               ║
║  🔍 Searching                               ║
║  📊 Sorting                                 ║
║  🌳 Trees & AVL Trees                       ║
║  🕸️ Graphs & BFS                            ║
║  🌐 Minimum Spanning Trees                  ║
║  🏗️ Practical DSA Projects                 ║
║                                              ║
╚══════════════════════════════════════════════╝

👨‍💻 Author

Muhammad Ali Saagar

BS Computer Science

This repository represents my practical work, experimentation, assignments, and projects throughout my university Data Structures & Algorithms coursework.


🧠 Learn the structure. Understand the algorithm. Solve the problem.

⭐ If this repository helped you understand DSA, consider giving it a star!

Built with C++ • Data Structures • Algorithms • Curiosity 🚀

About

A comprehensive C++ Data Structures & Algorithms repository covering semester coursework, hands-on implementations, problem-solving, advanced topics, and practical projects from arrays and linked lists to trees, graphs, sorting, searching, recursion, stacks, and queues.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages