Bishalsarang / Recursion-Tree-Visualizer

A simple python package that helps to visualise any recursive function by adding a single line of code.
https://pypi.org/project/recursion-visualiser/
MIT License
111 stars 17 forks source link

Unexpected Result #10

Closed bam4564 closed 3 years ago

bam4564 commented 4 years ago

Hello! First of all I think this is a really interesting little tool. I'm thinking about launching a youtube channel where I cover solutions to common interview questions in depth and this could potentially be very useful.

I've got the package installed and working correctly (ran it on fibonacci demo and got the expected result) but when I used it with one of my own functions I got something unexpected.

I've included the code I was running and the output image. The code is for generating all permutations over an input array. The output graph is a series of disconnected components which doesn't make sense to me.

Screen Shot 2020-10-31 at 2 52 36 PM

permutations

Bishalsarang commented 4 years ago

Sorry for the late reply. I have been busy lately. I'll look into the issue and get back to you.

In the meantime you can view the code from example section and see if that can be of any help.

Bishalsarang commented 4 years ago

The issue is when we mutate the function argument. perm I have removed the parameter res from the drawing for testing purposes.

Is it the expected diagram? we can make the package work with the above case too. If you verify then I can implement the feature within this week. @brycemorrow4564