cpp-excersiser is a collection of small but fun C++ exercises – created for practicing, improving problem-solving skills, and exploring the C++ language in more depth.
The repository currently contains examples such as:
DuplicateCounter.cpp
– counting duplicates (e.g., in a file or in a list)ListMerge.cpp
– merging or joining two listsPreprocessData.cpp
– preprocessing data (filtering, transforming, etc.)SuperStack.cpp
– implementing an advanced stack with extended operationsTreeDepth.cpp
– calculating the depth of a tree
-
Clone the repo:
git clone https://github.com/zstarczali/cpp-excersiser.git cd cpp-excersiser
-
Compile the exercise you want to try. For example:
g++ -std=c++17 DuplicateCounter.cpp -o DuplicateCounter
You can also use Visual Studio, CLion, or any IDE of your choice.
-
Run the program:
./DuplicateCounter
On Windows:
DuplicateCounter.exe
Experiment with different inputs to see how the solution behaves (e.g., empty input, large data).
- Practice: great for improving algorithmic thinking.
- C++ skills: use of STL, data structures, pointers, memory handling, recursion, etc.
- Learning steps: problems can be solved in a straightforward way first, then optimized later.