Skip to content

daniyal-dar/data-structures

Repository files navigation

Data Structures in C++

This repository contains robust implementations of fundamental data structures in C++, along with solutions to real-world scenario problems and practice questions curated from various competitive programming platforms and academic sources.

Note: Problem solutions do not include the full data structure implementations. To run them, you must download the required header files from the Implementations section or folder and save them in the same directory as the solution file. The solutions are pre-linked to these files via #include statements.

🚀 Quick Navigation

Use the links below to jump to specific files:

🔍 Algorithms

🛠 Implementations

Core data structures implemented from scratch.

🧩 Problems

📚 Stack Problems

Problem Link Description Category
Maze-Escape Find a path out of a grid-based maze Scenario based Question
Next greater element Find the first greater element to the right for each array element Scenario based Question
Infix to pre and post fix conversion Convert standard infix expressions to prefix and postfix notations Practice Questions
Reverse Stack Reverse the elements of a stack using recursion or auxiliary space Practice Questions

👥 Queue Problems

Problem Link Description Category
TotalSum of min+max in SlidingWindow Calculate the sum of minimum and maximum elements in every subarray of size k Scenario based Question

🔗 Linked List Problems

Problem Link Description Category
Multiplayer board game implementation Implement the simple game mechanics using doublyLL (based on both pointers) Scenario based Question
Song playlist manager Implement the song playlist manager using DoublyLL (based on both pointers) Scenario based Question
Movie watchList manager Implement the movie watchlist manager using DoublyLL (based on both pointers) Scenario based Question
DeleteNode in O1 code a global function which removes node from the linked list in O1 time complexity Practice problem
PalindromeList using stack code a global function which finds the LL is palindrome uising stack and given LL Practice problem

🔄 Recursion Problems

Problem Link Description Category
String reverse recursively Reverse a string without using loops Practice Question
Palindrome recursively Check if a string reads the same backward as forward using recursion Practice Questions
LCM of numbers Find the Least Common Multiple of an array of numbers recursively Practice Questions
Factorial Compute the factorial of a given number using a recursive base case Practice Questions
StairsClimb Count the distinct ways to reach the top of a staircase Scenario based Questions
Maze escape recursively Solve a maze problem pathfinder logic using recursion back-tracking Scenario based Questions
Print LinkedList recursively Traverse and display linked list elements using recursive calls Practice Question

🤝 How to Contribute

Contributions are welcome! If you want to add a new data structure or any practice question follow the given steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-new-solution).
  3. Commit your changes (git commit -m 'Add new DS solution').
  4. Push to the branch (git push origin feature-new-solution).
  5. Open a Pull Request.

🐛 Bug Reporting

If there is any bug supported, please report it! You can do this by:

  1. Navigating to the Issues tab.
  2. Clicking on New Issue.
  3. Describing the bug and providing the code snippet where it occurs.

Happy Coding!

Releases

No releases published

Packages

 
 
 

Contributors

Languages