From f9fe247277268a54d5b4f8ddb4c7a3dfc8141ac9 Mon Sep 17 00:00:00 2001 From: Mojirade18 Date: Wed, 8 Oct 2025 11:51:00 +0100 Subject: [PATCH 1/5] docs: added README for C++ section with compile instructions --- CPP/README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 CPP/README.md diff --git a/CPP/README.md b/CPP/README.md new file mode 100644 index 0000000..8ed41a1 --- /dev/null +++ b/CPP/README.md @@ -0,0 +1,65 @@ +# C++ Folder Guide — DSA Collection + +Welcome to the **C++** section of the DSA-Collection repository! +This guide explains how to compile and execute C++ files, follow naming conventions, and contribute effectively. + +--- + +## Folder Structure + +Each folder below represents a category of data structures or algorithms: + +CPP/ +├── Array/ +├── Backtracking/ +├── Basics/ +├── BinarySearchTree/ +├── Heap/ +├── SystemDesign/ +├── dynamic-programming/ +├── graph/ +├── linked-list/ +├── pattern/ +├── searching/ +├── sorting/ +├── strings/ +├── tree-algorithm/ +└── tree/ + + +Each folder contains one or more `.cpp` files implementing specific problems. + +--- + +## How to Compile and Run a C++ File + +To compile and execute C++ programs, make sure you have a **C++ compiler** installed (e.g., `g++`, part of GCC). +You can check your version by running: + +```bash +g++ --version + +Steps: + +1️ Navigate to the directory of your desired file + +cd CPP/sorting + + +2️ Compile the file + +g++ filename.cpp -o output + + +For modern C++ features, use: + +g++ -std=c++17 filename.cpp -o output + + +3️ Run the program + +./output + +Example: +g++ quick_sort.cpp -o quick_sort +./quick_sort \ No newline at end of file From d5afb66aa009fb01a09fbaf21abe7d336b367539 Mon Sep 17 00:00:00 2001 From: Mojirade18 Date: Wed, 8 Oct 2025 12:11:35 +0100 Subject: [PATCH 2/5] Fix: Marked file as documentation only (README.md) --- CPP/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CPP/README.md b/CPP/README.md index 8ed41a1..c1618ca 100644 --- a/CPP/README.md +++ b/CPP/README.md @@ -9,6 +9,7 @@ This guide explains how to compile and execute C++ files, follow naming conventi Each folder below represents a category of data structures or algorithms: +```text CPP/ ├── Array/ ├── Backtracking/ From 66dbecf73429788ecf579280d2033da2f1d2c529 Mon Sep 17 00:00:00 2001 From: Adekanmi Mojirade <113867534+Mojirade18@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:12:44 +0100 Subject: [PATCH 3/5] Update README.md --- CPP/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CPP/README.md b/CPP/README.md index c1618ca..945abd4 100644 --- a/CPP/README.md +++ b/CPP/README.md @@ -63,4 +63,5 @@ g++ -std=c++17 filename.cpp -o output Example: g++ quick_sort.cpp -o quick_sort -./quick_sort \ No newline at end of file + +./quick_sort From 0582487673ba1393aecb9035a1798faf05cc7e24 Mon Sep 17 00:00:00 2001 From: Mojirade18 Date: Wed, 8 Oct 2025 13:27:56 +0100 Subject: [PATCH 4/5] Fix: Marked file as documentation only (README.md) --- CPP/README.md | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/CPP/README.md b/CPP/README.md index c1618ca..c46070e 100644 --- a/CPP/README.md +++ b/CPP/README.md @@ -1,6 +1,6 @@ -# C++ Folder Guide — DSA Collection +# C++ Folder Guide — DSA Collection -Welcome to the **C++** section of the DSA-Collection repository! +Welcome to the C++ section of the DSA-Collection repository! This guide explains how to compile and execute C++ files, follow naming conventions, and contribute effectively. --- @@ -9,6 +9,7 @@ This guide explains how to compile and execute C++ files, follow naming conventi Each folder below represents a category of data structures or algorithms: + ```text CPP/ ├── Array/ @@ -27,6 +28,7 @@ CPP/ ├── tree-algorithm/ └── tree/ +```` Each folder contains one or more `.cpp` files implementing specific problems. @@ -39,28 +41,36 @@ You can check your version by running: ```bash g++ --version +```` -Steps: - -1️ Navigate to the directory of your desired file +### 1️⃣ Navigate to the directory of your desired file +```bash cd CPP/sorting +``` +### 2️⃣ Compile the file -2️ Compile the file - +```bash g++ filename.cpp -o output +``` +For modern C++ features (e.g., C++17): -For modern C++ features, use: - +```bash g++ -std=c++17 filename.cpp -o output +``` +### 3️⃣ Run the program -3️ Run the program - +```bash ./output +``` -Example: +### Example + +```bash g++ quick_sort.cpp -o quick_sort -./quick_sort \ No newline at end of file +./quick_sort +``` + From 34c5ff852a8c28b23228a6b3421d7a788e9fb883 Mon Sep 17 00:00:00 2001 From: Mojirade18 Date: Wed, 8 Oct 2025 13:43:31 +0100 Subject: [PATCH 5/5] Edited README.md --- CPP/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CPP/README.md b/CPP/README.md index 86bc9fe..d366023 100644 --- a/CPP/README.md +++ b/CPP/README.md @@ -72,8 +72,5 @@ g++ -std=c++17 filename.cpp -o output ```bash g++ quick_sort.cpp -o quick_sort -(your local version of the README) - -(remote version from GitHub)