Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add palindrome partitioning algorithm #1319

Merged
merged 4 commits into from
Oct 25, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update palindrome_partitioning.cpp
  • Loading branch information
KomoderHell committed Oct 20, 2020
commit 7cebcee76f4c6e1953fa40dd5bcea09761855371
9 changes: 5 additions & 4 deletions dynamic_programming/palindrome_partitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @details
* palindrome partitioning uses dynamic programming and goes to all the possible partitions to find the minimum
* you are given a string and you need to give minimum number of partitions needed to divide it into a number of palindromes
* [Palindrome Partitioning] (https://www.geeksforgeeks.org/palindrome-partitioning-dp-17/)
* overall time complexity O(n^2)
* For example: example 1:-
* String : "nitik"
Expand All @@ -25,13 +26,13 @@

/**
* @namespace dynamic_programming
* @brief dynamic programming algorithms
* @brief Dynamic Programming algorithms
*/
namespace dynamic_programming {

/**
* @namespace palindrome_partitioning
* @brief palindrome partitioning algorithms
* @brief Functions for [Palindrome Partitioning] (https://leetcode.com/problems/palindrome-partitioning-ii/) algorithm
ayaankhan98 marked this conversation as resolved.
Show resolved Hide resolved
*/
namespace palindrome_partitioning {

Expand Down Expand Up @@ -87,7 +88,7 @@ namespace dynamic_programming {
} // namespace dynamic_programming

/**
* Test Function
* @brief Test Function
* @return void
*/
static void test() {
Expand Down Expand Up @@ -119,6 +120,6 @@ static void test() {
* @returns 0 on exit
*/
int main() {
test();
test(); // execute the test
return 0;
}