Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding measures of sortedness/disorder in arrays #448

Open
HarsheetKakar opened this issue Dec 4, 2021 · 5 comments
Open

Adding measures of sortedness/disorder in arrays #448

HarsheetKakar opened this issue Dec 4, 2021 · 5 comments

Comments

@HarsheetKakar
Copy link
Contributor

HarsheetKakar commented Dec 4, 2021

We should provide a function that should take an array as input and suggest one of the pydatastructs APIs as output. The time complexity should be O(n) because anything more won't be worth it. The constant in O(n) should also be very small (we can benchmark for that).

References

.. [1] https://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=5F6D0F8B0B37F0A66AAD3100BD0459E7?doi=10.1.1.45.8017&rep=rep1&type=pdf

@HarsheetKakar
Copy link
Contributor Author

@czgdp1807 feel free to edit the discription. As far as the O(n) complexity we are talking about, is this for checking the "sortedness" or sorting the array. As for the latter we will need to put constraints on the nature of elements passed in the array (e.g. I dont think we will be able to promise O(n) in case of floating point numbers IMHO).

And as far as checking the sortedness of the array, I was thinking of going for a probabilistic algorithm (some of which can go as low as O(log(n)/e) where e is the "distance" from sorted array).

@czgdp1807
Copy link
Member

czgdp1807 commented Dec 4, 2021

As far as the O(n) complexity we are talking about, is this for checking the "sortedness" or sorting the array

I am referring to the sortedness.On the basis of the sortedness, we should suggest the sorting algorithm from pydatastructs.

I was thinking of going for a probabilistic algorithm (some of which can go as low as O(log(n)/e) where e is the "distance" from sorted array).

Is the any research work that already explores this?

N.B. https://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=5F6D0F8B0B37F0A66AAD3100BD0459E7?doi=10.1.1.45.8017&rep=rep1&type=pdf

@HarsheetKakar
Copy link
Contributor Author

Is the any research work that already explores this?

Yes Hamming Distance

@czgdp1807
Copy link
Member

In the paper in my above comment, section I.2 lists 10 measures of disorder for arrays. I feel that all these are worth adding into pydatastructs.

@czgdp1807 czgdp1807 changed the title Creation of SortedOneDimentionalArray Datastructure Adding measures of sortedness/disorder in arrays Dec 5, 2021
@mridul45
Copy link

As a GSSOC 23 member , I request you to assign issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants