You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lecture-by-lecture implementations of data structures and algorithms in C++, covering language fundamentals through recursion and backtracking. Each file is self-contained and runnable.
Contents
C++ Fundamentals
File
Topic
Lecture2.cpp
Input / output basics
Lecture3.cpp
Conditional statements
Lecture4.cpp
Pattern printing
Lecture5.cpp
Bitwise operators
Lecture6.cpp
Math library functions
Lecture8.cpp
Functions and parameter passing
Arrays, Vectors & Searching
File
Topic
Lecture9.cpp
Array traversal and reversal
Lecture10.cpp, Lecture13.cpp, Lecture15.cpp
Vectors (STL)
Lecture12.cpp
Binary search
Lecture14.cpp
Integer square root — binary search on the answer
Lecture23.cpp
Search in a 2D sorted matrix
Lecture24.cpp
Fast exponentiation
Sorting
File
Topic
Lecture16.cpp
Selection sort
Lecture17.cpp
Bubble sort
Lecture18.cpp
Insertion sort
Lecture35.cpp
Merge sort
Lecture36.cpp
Quick sort
Array Problems
File
Topic
Lecture20.cpp
Merge sorted array in place
Lecture21.cpp
Rotate array
Lecture22.cpp
String compression
Pointers & Memory
File
Topic
Lecture25.cpp
Pointer basics
Lecture26.cpp
Pointers as function arguments
Lecture27.cpp
Double pointers
Lecture28.cpp
References
Lecture29.cpp
Jagged arrays and dynamic allocation
Lecture30.cpp
Macros and the preprocessor
Recursion & Backtracking
File
Topic
Lecture31.cpp
Head and tail recursion
Lecture32.cpp
Recursion on a number line
Lecture33.cpp
Recursion over arrays
Lecture34.cpp
Recursive insertion sort
Lecture37.cpp
Subsets
Lecture38.cpp
Letter combinations of a phone number
Lecture39.cpp
Permutations
Lecture40.cpp
Backtracking practice
Running a file
g++ Lecture12.cpp -o solution
./solution
On Windows, ./solution becomes solution.exe.
Notes
Several problems are drawn from LeetCode and are written in the class Solution form so they can be pasted straight into the judge. The accompanying .pdf files are lecture notes kept alongside the code for reference.
About
Data Structures and Algorithms in C++ — lecture-wise implementations and practice problems