Java icon indicating copy to clipboard operation
Java copied to clipboard

[FEATURE REQUEST] Basic Recursion

Open Tuhinm2002 opened this issue 1 year ago • 9 comments

What would you like to Propose?

I found Dynamic Programming is there but the basic Recursion is not there. Problems like finding power set or subsets can only be done using recursion. Recursion plays an crucial role for setting the strong foundation for Dynamic programming.

My test cases :

package com.thealgorithms.Recursion;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

import java.util.ArrayList;

public class SubsetsTest {

    @Test
    void subset(){
        String str = "abc";
        ArrayList<String> ans = new ArrayList<>();
        ArrayList<String> actual = new ArrayList<>();
        ans.add("abc");
        ans.add("ab");
        ans.add("ac");
        ans.add("a");
        ans.add("bc");
        ans.add("b");
        ans.add("c");
        ans.add("");

        Subsets.subset("",str,actual);
        assertEquals(ans.toString(),actual.toString());
    }
}

Issue details

There is no package for recursion and recursion problems like producing subsets and powerset

Additional Information

No response

Tuhinm2002 avatar Oct 01 '24 14:10 Tuhinm2002

Hi @Tuhinm2002 , I would like to contribute to this. I am not able to understand what is required here. Can you explain it in a brief?

Thanks !!!

dipeshsingh253 avatar Oct 01 '24 14:10 dipeshsingh253

Is it still open for assignments?

raxvab avatar Oct 01 '24 19:10 raxvab

Is it still open for assignments?

No its not an assignment. It is a feature request originally opened by me. First read contribution.md file before contributing

Tuhinm2002 avatar Oct 02 '24 05:10 Tuhinm2002

I guess @sujitgunjal is already working on it.

dipeshsingh253 avatar Oct 02 '24 05:10 dipeshsingh253

I guess @sujitgunjal is already working on it.

Nope its originally requested by me as a feature. Its not an assignment

Tuhinm2002 avatar Oct 02 '24 05:10 Tuhinm2002

@Tuhinm2002 so you want to add these features yourself, right? Feel free to create a PR with them and tests

siriak avatar Oct 02 '24 07:10 siriak

@Tuhinm2002 so you want to add these features yourself, right? Feel free to create a PR with them and tests

Yeah I created a PR with the name feat: recursion subsets added. Please review it. And after it gets merge I will complete the package all at once in the next PR. Because in this PR it is not possible to edit 😅

Tuhinm2002 avatar Oct 02 '24 07:10 Tuhinm2002

Please assign the task to me

Nandinig24 avatar Oct 06 '24 09:10 Nandinig24

Please assign the task to me

It's not an assignment it's a feature request which has already been merged

Tuhinm2002 avatar Oct 06 '24 09:10 Tuhinm2002

Done

siriak avatar Oct 07 '24 17:10 siriak