pydatastructs icon indicating copy to clipboard operation
pydatastructs copied to clipboard

Add `ImplicitArray`

Open czgdp1807 opened this issue 3 years ago • 8 comments

Description of the problem

As of now in OneDimensionalArray and subclasses we store all the data explicitly in memory. ImplicitArray will just store a function object. This function object will return values for different indices. That way the memory requirement will be reduced to a constant. This will be useful for cases where search algorithms don't need an explicit array but a range and some values associated with that range.

Example of the problem

References/Other comments

czgdp1807 avatar Dec 09 '21 08:12 czgdp1807

Hey, @czgdp1807 I want to work on this issue. Can you please tell me ways to get started?

hassanrahim26 avatar Dec 09 '21 13:12 hassanrahim26

Sure go ahead. Well it's about adding new classes (ImplicitArray, OneDimensionalImplicitArray) in arrays.py with same interface (methods in simpler terms) as Array, OneDimensionalArray. There is a lot of code in arrays.py which you can go through and follow the same pattern for adding implicit arrays.

czgdp1807 avatar Dec 09 '21 13:12 czgdp1807

So, do I've to create a new class like this:-

class ImplicitArray(Array):
    pass

class OneDimensionalImplicitArray(ImplicitArray, OneDimensionalArray):
    "Here I've to declare the functions of this class"

hassanrahim26 avatar Dec 09 '21 14:12 hassanrahim26

Yeah exactly. In fact, the classes you have inherited seems about right.

czgdp1807 avatar Dec 09 '21 14:12 czgdp1807

Alright then. I'll work on this issue and I'll create a PR for this.

hassanrahim26 avatar Dec 09 '21 14:12 hassanrahim26

hi can you assign me this issue under GSSOC23 .

NIveX2169 avatar May 20 '23 07:05 NIveX2169