Skip to content

Contains implementation of various data structures and algorithmic techniques in C++.

Notifications You must be signed in to change notification settings

SuryankDixit/Problem-Solving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Problems

Here you can find solutions for various coding/algorithmic problems and many useful resources for learning algorithms and data structures.
Also, this repo will be updated with new solutions and resources from time to time.

Note that this repo is meant to be used for learning and researching purposes only and it is not meant to be used for production.

Solutions

Algorithms and data structures are not language-specific (it's true that some languages are faster, and some are easier to use), but if you are good with the logic and pseudocode, any language would be good.
So I've decided to use C++/C
So, to execute these solutions there is no need from installing any external packages. Most of the links to the respective questions are either added in the code as comment or as a commit message

Note that I'm not the author of these problems, they are from sites like LeetCode (you can find more than 40 sites like this in the Training Sites section). Only the solutions and explanations are mine. If you find any bug or incorrect implementation (or faster/better implementation) in this repo, please let me know by opening an issue or pull request.

Categories

Each solution/problem in this repo belongs to one of these categories:

  1. Graph -DFS,BFS, Shortes Paths, Cycles,Euler Tour, Spanning Trees, Bipartite Graphs, Strongly Connected Components, Topological Sorting etc.
  2. Dynamic Programming - 3D, 2D and 1D Dynamic Programming, LCS, LIS, Knapsack, MCM, DP on Tress , DP on Strings etc.
  3. Segment Tree Implementation, Range Query.
  4. Trie Implementation, Unique Prefix Array, Max Xor Pairs.
  5. Arrays - Array Manipulations, Sorting, Prefix Sum, Sliding Window, etc.
  6. Linked Lists - Linked List Searching, Pointer Manipulations, etc.
  7. Trees - Binary Search Trees, Tree Traversals: Breadth-First (Level Order) Traversal, Depth-First Traversal (Inorder, Preorder, Postorder),Successors, Forest, Sum Tress, LCA etc.
  8. Recursion and Backtracking - Permutations,Combinations, Sudoku Solver, N-Queens
  9. Math - Combinatorics, Prime,GCD, LCM, Factorization, Geometry, Math Formulas, etc.
  10. Binary Search
  11. Sorting Bubble, Insertion,Merge, Quick Sort etc.
  12. Heap
  13. HashTable
  14. Stacks
  15. Greedy
  16. Euler Project Solution
  17. Bitwise Operations
  18. Other -Arrays, Matrices,Searching ,Sorting, String.

Learning Resources

The learning resources are divided into 4 categories: Courses, Books, Training Sites, Other Resources.

Courses

Collection of free courses from one of the best CS universities.

  1. Stanford University

  2. Princeton University

  3. UC San Diego

  4. MIT University

  5. Harvard University

  6. UC Berkeley

Books

Several books that have made an impression on me:

  1. Grokking Algorithms by Aditya Bhargava - The best book for complete beginners in algorithms! I wish this book existed when I started learning algorithms.
  2. Introduction to Algorithms by CLRS - This book is called the "bible textbook of algorithms" by many programmers.
  3. Algorithms by Robert Sedgewick & Kevin Wayne - These authors are instructors of the previously mentioned Coursera courses: Algorithms Part 1 and Algorithms Part 2. Also, this book has an excellent and free site with exercises, presentations, and examples.
  4. The Algorithm Design Manual by Steven Skiena - The book describes many advanced topics and algorithms and it focuses on real-life practical examples. This book has one of the best sites with resources (solutions, algorithms and data structures, python implementations).
  5. Algorithms by S. Dasgupta, C. Papadimitriou, and U. Vazirani - This book is an official book for algorithms and data structures classes in several famous universities.
  6. Competitive Programming 3 by Steven Halim & Felix Halim - A great book that prepares you for competitive programming (not for complete beginners). You can learn many things and tricks about competitive programming. But if your goal is to prepare for competitive programming then choose a faster language than Python, C/C++ (or Java, it's faster than Python but not like C/C++).
  7. Cracking the Coding Interview by Gayle Laakmann McDowell - A bit different from the previous books. Prepares you for coding interviews using great coding problems.

Training Sites

If the problems from LeetCode are not enough and you need more problems like those, you can find much more on these platforms:

Other Resources

  1. Geeks For Geeks - The site which all interested in algorithms (no matter if beginners or experts) should know! YouTube channel with many useful videos.
  2. The Algorithms - Python - Great GitHub repo with many algorithms written in Python (Link from the same repo written in other programming languages).
  3. CP Algorithms - Great page with excellent explanations for various algorithms.
  4. Visualizers:
    • USFCA Visualization Tool - Great tool for visualizing data structures and algorithms, created by the University of San Francisco.
    • VisuAlgo - Another great tool for visualizing data structures and algorithms through animation.
    • Algorithm Visualizer - Interactive online platform that visualizes algorithms from code. This platform is an open-source project, here you can find the source code.
  5. Courses and tutorials (but not from universities like the Courses section):
  6. YouTube playlists with tutorials:

About

Contains implementation of various data structures and algorithmic techniques in C++.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published