diff --git a/src/main/java/com/thealgorithms/recursion/GenerateSubsets.java b/src/main/java/com/thealgorithms/recursion/GenerateSubsets.java index 5a3ff2e88040..0114a55e5b75 100644 --- a/src/main/java/com/thealgorithms/recursion/GenerateSubsets.java +++ b/src/main/java/com/thealgorithms/recursion/GenerateSubsets.java @@ -1,36 +1,52 @@ package com.thealgorithms.recursion; -// program to find power set of a string - import java.util.ArrayList; import java.util.List; +/** + * Utility class to generate all subsets (power set) of a given string using recursion. + * + *
For example, the string "ab" will produce: ["ab", "a", "b", ""]
+ */
public final class GenerateSubsets {
private GenerateSubsets() {
- throw new UnsupportedOperationException("Utility class");
}
+ /**
+ * Generates all subsets (power set) of the given string using recursion.
+ *
+ * @param str the input string to generate subsets for
+ * @return a list of all subsets of the input string
+ */
public static List Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages. Alternative Proxies:Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.