codezonediitj / pydatastructs

A python package for data structures and algorithms
https://pydatastructs.readthedocs.io/en/stable/
Other
201 stars 267 forks source link

Prospective Ideas #343

Open Smit-create opened 3 years ago

Smit-create commented 3 years ago

Some of the ideas to start working on: Adding a few basic and necessary functions:

  1. upper_bound: (similar to that of cpp's upper_bound) that should work on sorted OneDimensionalArray.
  2. lower_bound: (similar to that of cpp's lower_bound) that should work on sorted OneDimensionalArray
  3. is_sorted: To check that a given OneDimensionalArray is sorted or not.
  4. binary_search: To search for a given key in sorted OneDimensionalArray.

Adding few Datastructes:

  1. Adding a class of multiset (similar to cpp's multiset)
  2. Adding a class of Fenwick tree
  3. Adding a class of Sparse Table
  4. Adding a class of StringHashFunction
  5. LCA for DAG/tree

Some more ideas on strings and Graphs can also be found here: https://github.com/codezonediitj/pydatastructs/wiki/Planned-Features-for-v0.0.1

The list will be updated based on the progress of the above ideas. We don't assign issues to any individual so whoever is willing to work on any of the above ideas (or on your own idea please let us know what you are working on) should discuss how he/she is going to design the API of the function/classes and how will it be useful. For example, if I am willing to work on adding binary_search for sorted ODA, then I would show its working in the comments below as:

binary_search(array, start, end, key, cmp=None):
    # its algo (not necessary to show here in comments just show how the function/class will look like)
    return True if found else False
Nora2412 commented 3 years ago

I would like to work on is_sorted and binary_search as part of my contribution for GSSOC'21. For example,

is_sorted(array, start,end):
          # algo 
          return True if sorted else false
Smit-create commented 3 years ago

Yes, you can try raising a PR for that by adding the said functions under https://github.com/codezonediitj/pydatastructs/blob/master/pydatastructs/linear_data_structures/algorithms.py

sHiVaNgI821 commented 3 years ago

I would like to work on the upper_bound and lower_bound functions which would be a part of the algorithms.py file, as part of GSSoC'21 The function definition goes like-

def upper_bound(array, start, end, value):
           # algo (returns the index of the upper bound of the given value from start to end indices of a OneDimensionalArray)
           return index
def lower_bound(array, start, end, value):
           # algo (returns the index of the lower bound of the given value from start to end indices of a OneDimensionalArray)
           return index
Smit-create commented 3 years ago

Yes, please raise a PR for the same.

Simar05519 commented 3 years ago

I would like to work on binary search.

Smit-create commented 3 years ago

I would like to work on binary search.

You can raise a PR for that since no one has worked for it till now.

Simar05519 commented 3 years ago

ok

On Mon, Mar 15, 2021 at 3:09 PM Smit Lunagariya @.***> wrote:

I would like to work on binary search.

You can raise a PR for that since no one has worked for it till now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codezonediitj/pydatastructs/issues/343#issuecomment-799272148, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBFEQ7EBQHUYCWC6WNSOMTTDXIWVANCNFSM4Y7RDPIA .

vi-hna-ja commented 3 years ago

Hello, @Smit-create I would like to work on KMP and Fenwick tree. Can I start working on it?

Smit-create commented 3 years ago

Sure!

sHiVaNgI821 commented 3 years ago

I would like to work on the sparse table class which would be a part of miscellaneous data structures, as part of my contribution for GSSoC'21

sHiVaNgI821 commented 3 years ago

I would like to work on lowest_common_ancestor (LCA for DAG/Tree) function which would be a part of the algorithms.py file in the graphs directory, as part of my contribution for GSSoC'21. The function definition goes like:

def lowest_common_ancestor(graph: Graph, vertex1: str, vertex2: str, algorithm: str) -> str: 
             # algo
             returns lca_vertex