misc-problem-solutions
Showcases and solutions to various popular programming problems, written in C90, C++17, C++20, and C++23
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.5%) to scientific vocabulary
Keywords
Repository
Showcases and solutions to various popular programming problems, written in C90, C++17, C++20, and C++23
Basic Info
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Solutions in C and C++ to Miscellaneous Programming Problems
This is a repository of modern coding showcases and solutions to various popular programming problems, written in C90, C++17, C++20, and C++23.
For some of the said problems, multiple solutions of varying efficiencies and trade-offs are provided, along with benchmarks.
All solutions are driven by extensive automated testing, in addition to being statically and dynamically analyzed, and compiled under strict rules with the latest Clang, GCC, and MSVC compilers.
Technical showcases
The following is a partial list of standards, practices, paradigms, and tools leveraged by this project:
- C (standard C90) and C++ (standard C++17, C++20, and C++23)
- The C and C++ standard libraries
- Strongly-typed approach, leveraging C++ templates and C++20 concepts
- Exception safety-aware design
- Const correctness is applied where applicable, except for fields
- Functional programming
- Generic programming
- Strict standard conformance and strict compilation rules
- Static analysis with Clang Tidy and Microsoft C++ Code Analysis
- Dynamic analysis
- LLVM-based sanitizer tools
- Target property-based CMake configuration
- Clean Git history and configuration
- Extensive testing using Catch2, FuzzTest, GTest, and CTest
- Development dependency management using vcpkg
- Own opinionated Clang Format configuration
- Conventional Commits
- GitHub Actions CI
- Benchmarking using nanobench
- Microsoft DevSkim
- EditorConfig
- Markdown
- Diagramming with Mermaid
Index
| Problem | Standard | Source |
| --- | --- | --- |
| Add Two Numbers | C++17 | src/forfun/add_two_numbers.cpp |
| Add Two Numbers (in C) | C90 | src/forfun_c/add_two_numbers.c |
| Balanced Binary Tree | C++23 | include/forfun/graph/balanced_binary_tree.hpp |
| Best Time to Buy And Sell Stock | C++20 | include/forfun/best_time_to_buy_and_sell_stock.hpp |
| Binary Search | C++20 | include/forfun/search/binary_search.hpp |
| Breadth-First Search | C++20 | include/forfun/graph/breadth_first_search.hpp |
| Bubble Sort | C++20 | include/forfun/sorting/bubble_sort.hpp |
| Concatenation of Array | C++23 | include/forfun/array_concatenation.hpp |
| Container with Most Water | C++20 | include/forfun/container_with_most_water.hpp |
| Contains Duplicate | C++20 | include/forfun/contains_duplicate.hpp |
| Depth-First Search | C++20 | include/forfun/graph/depth_first_search.hpp |
| Encode and Decode Strings | C++20 | src/forfun/encode_and_decode_strings.cpp |
| Evaluate Reverse Polish Notation | C++23 | include/forfun/evaluate_reverse_polish_notation.hpp |
| Factorial | C++23 | include/forfun/factorial.hpp |
| Fibonacci Sequence | C++20 | include/forfun/fibonacci_sequence.hpp |
| First Missing Positive | C++20 | include/forfun/first_missing_positive.hpp |
| Fizz Buzz | C++20 | include/forfun/fizzbuzz.hpp |
| Forward List | C++20 | include/forfun/container/forward_list.hpp |
| Greatest Common Divisor | C++20 | include/forfun/gcd.hpp |
| Group Anagrams | C++23 | include/forfun/group_anagrams.hpp |
| Hamming Weight | C++23 | include/forfun/hamming_weight.hpp |
| House Robber | C++20 | include/forfun/house_robber.hpp |
| Insertion Sort | C++20 | include/forfun/sorting/insertion_sort.hpp |
| Invert Binary Tree | C++17 | src/forfun/graph/invert_binary_tree.cpp |
| Last Stone Weight | C++20 | include/forfun/last_stone_weight.hpp |
| Least Recently Used (LRU) Cache | C++23 | src/forfun/lru_cache.cpp |
| Linked List | C++20 | include/forfun/container/list.hpp |
| List Bidirectional Iterator | C++20 | include/forfun/container/internal/list_iterator.hpp |
| Longest Consecutive Sequence | C++23 | include/forfun/longest_consecutive_sequence.hpp |
| Maximum Subarray | C++20 | include/forfun/maximum_subarray.hpp |
| Meeting Rooms (I, II) | C++23 | include/forfun/meeting_rooms.hpp |
| Missing Number | C++23 | include/forfun/missing_number.hpp |
| Move Zeroes | C++20 | include/forfun/move_zeroes.hpp |
| Multiples of Three or Five | C++17 | include/forfun/project_euler/p0001_multiples_of_3_or_5.hpp |
| Nth Fibonacci Number | C++20 | include/forfun/fibonacci.hpp |
| Number of Ships in a Rectangle | C++20 | src/forfun/sonar.cpp |
| Palindrome | C++20 | include/forfun/palindrome.hpp |
| Palindrome (in C) | C90 | src/forfun_c/palindrome.c |
| Palindromic Number | C++20 | src/forfun/palindromic_number.cpp |
| Primality Test | C++20 | include/forfun/primality.hpp |
| Product of Array Except Self | C++20 | include/forfun/product_except_self.hpp |
| Quicksort | C++20 | include/forfun/sorting/quicksort.hpp |
| Reverse Forward List | C++20 | include/forfun/container/forward_list.hpp |
| Set Matrix Zeroes | C++20 | src/forfun/set_matrix_zeroes.cpp |
| Single Number | C++23 | include/forfun/single_number.hpp |
| Squares of a Sorted Array | C++20 | include/forfun/squares_sorted_array.hpp |
| Subsets | C++20 | include/forfun/graph/subsets.hpp |
| Sums of Subarrays of Length K | C++20 | include/forfun/sub_array_sums.hpp |
| Three Sum (3SUM) | C++20 | include/forfun/three_sum.hpp |
| Top K Frequent Elements | C++23 | include/forfun/top_k_frequent_elements.hpp |
| Tower of Hanoi | C++20 | include/forfun/tower_of_hanoi.hpp |
| Trie | C++20 | include/forfun/trie.hpp |
| Two Sum (I, II) | C++23 | include/forfun/two_sum.hpp |
| Two-pass Boyer-Moore Majority | C++20 | include/forfun/majority_element.hpp |
| Valid Anagram | C++23 | include/forfun/valid_anagram.hpp |
| Valid Parentheses | C++20 | src/forfun/valid_parentheses.cpp |
| Valid Sudoku | C++23 | include/forfun/valid_sudoku.hpp |
Disclaimer
The provided attempted solutions are not guaranteed to be correct, safe, secure, optimal, or suitable for use in production. The code and coding style may, or may not, follow best practice guidelines.
License
Problem licenses
Problem copyrights are reserved to their respective owners.
Solution licenses
Solution code is released under an MIT-style license. Copyright © Omar Boukli-Hacene. All rights reserved.
SPDX license identifier: MIT.
Written for the joy of it 🪐
Owner
- Name: Omar Boukli-Hacene
- Login: oboukli
- Kind: user
- Repositories: 4
- Profile: https://github.com/oboukli
Citation (CITATION.cff)
cff-version: 1.2.0
title: Solutions in C and C++ to miscellaneous programming problems
message: If you use this work, kindly cite it using these metadata.
type: software
authors:
- given-names: Omar
family-names: Boukli Hacene
repository-code: https://github.com/oboukli/misc-problem-solutions
abstract: >-
This is a repository of modern coding showcases and solutions to various
popular programming problems, written in C90, C++17, C++20, and C++23.
keywords:
- algorithms
- c90
- cplusplus
- cpp
- cpp17
- cpp20
- cpp23
- data-structures
- dsa
- problem-solving
- puzzle
license: MIT
GitHub Events
Total
- Delete event: 224
- Push event: 417
- Pull request review event: 13
- Pull request review comment event: 8
- Pull request event: 431
- Create event: 220
Last Year
- Delete event: 224
- Push event: 417
- Pull request review event: 13
- Pull request review comment event: 8
- Pull request event: 431
- Create event: 220
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 6
- Total pull requests: 411
- Average time to close issues: about 13 hours
- Average time to close pull requests: about 11 hours
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 370
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 243
- Average time to close issues: about 12 hours
- Average time to close pull requests: about 9 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 213
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- oboukli (6)
Pull Request Authors
- oboukli (411)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- github/codeql-action/upload-sarif v2 composite
- microsoft/DevSkim-Action v1 composite
- actions/cache v3 composite
- actions/checkout c85c95e3d7251135ab7dc9ce3241c5835cc595a9 composite
- actions/upload-artifact 0b7f8abb1508181956e8e162db84b466c27e18ce composite
- github/codeql-action/upload-sarif 46a6823b81f2d7c67ddf123851eea88365bc8a67 composite
- microsoft/msvc-code-analysis-action 24c285ab36952c9e9182f4b78dfafbac38a7e5ee composite
- catch2 *
- fmt *
- nameof *
- nanobench *