Learning repository covering C++ fundamentals, data structures, and algorithms.
Requirements:
- GCC/G++ compiler
- IDE: VS Code (recommended)
- C/C++ extensions for VS Code(Optional)
Compile and run:
# Fundamentals
g++ -o pointers src/fundamentals/pointers.cpp
./pointers
# Data structures
g++ -o stack src/data-structures/stack.cpp
./stack
# Algorithms
g++ -o bubble src/algorithms/bubble-sort.cpp
./bubbleFor database interaction, install PostgreSQL C++ binding library:
- Install libpq-dev:
sudo apt install libpq-dev- Compile and run:
g++ -o user src/fundamentals/db/user.cpp -I/usr/include/postgresql -lpq
./userNote: Update database credentials in user.cpp before running.
-
Fundamentals - Start here if new to C++
fundamentals/pointers.cpp- Pointer basicsfundamentals/structs.cpp- Struct usagefundamentals/recursion.cpp- Recursion examplesfundamentals/db/user.cpp- PostgreSQL database integration
-
Data Structures - Core DSA implementations
- Stack: LIFO structure
- Queue: FIFO structure
- Linked Lists: singly, doubly linked
- Binary Trees: basic and advanced
-
Algorithms - Search and sort implementations
- Sorting: bubble, insertion, selection
- Searching: linear, binary
- Graph: Dijkstra's shortest path
- Grokking Algorithms, by Aditya Y. Bhargava
- Data Structures and Algorithm Analysis in C++, 4th edition, by Mark Allen Weiss