pydatastructs icon indicating copy to clipboard operation
pydatastructs copied to clipboard

Allow using array for constructing binary trees

Open czgdp1807 opened this issue 5 years ago • 9 comments

Description of the problem

Idea of using arrays for constructing binary trees originated from https://github.com/codezonediitj/pydatastructs/issues/38#issuecomment-562864441 which uses arrays for constructing binary heaps. The challenge is to make the change without breaking existing API. One approach can be using keyword arguments like, elements and the transformed API would look like,

def __new__(cls, key=None, root_data=None, comp=None,
                is_order_statistic=False, *args, **kwargs):

If the above is done then the existing tests for binary_trees.py can be shortened.

Example of the problem

References/Other comments

czgdp1807 avatar Dec 07 '19 16:12 czgdp1807

This can be done by passing the array of elements and in __new__ we can insert every element of passed array in object.tree , right?

23umesh avatar Dec 14 '19 09:12 23umesh

Yes we can do that. A PR would be better for explaining the solution.

czgdp1807 avatar Dec 14 '19 18:12 czgdp1807

@akshaygoelakki Feel free to start your work on this. Whenever you will create a PR, it will be linked to this issue and it will show up in assignee section.

czgdp1807 avatar Mar 07 '20 09:03 czgdp1807

I want to work on this issue. So kindly assign this issue to me .

nikipr1999 avatar Mar 15 '20 17:03 nikipr1999

@czgdp1807 Could you please provide the link for this code where the changes are to be made?

Jahnavi-Jonnalagadda avatar Apr 05 '20 01:04 Jahnavi-Jonnalagadda

i would like to work on this issue

ayushi-get avatar Jan 05 '21 11:01 ayushi-get

You have it! Start working.

sidhu1012 avatar Jan 05 '21 11:01 sidhu1012

I would like to work on this issue, @czgdp1807 kindly assign it to me!

dollyjain51099 avatar Feb 26 '21 11:02 dollyjain51099

@dollyjain51099 We don't assign issues to contributors. Anyone can work on any issue. Link the PR you open with this issue.

czgdp1807 avatar Feb 26 '21 14:02 czgdp1807