fms12 / DATA-STRUCTURE-AND-ALGORITHM-IN-PY

An open source codebase for sharing programming solutions. This repository is in development phase and will soon provide you with python code of various data structures and algorithms . as we all know that there are not much resources which is available to learn data structures and algorithms in python.
MIT License
23 stars 43 forks source link

Implemented Binary Search Tree with Python #216

Closed Kd-Here closed 1 year ago

Kd-Here commented 1 year ago

Hello geek Implemented BST with Python. Let me know if you have a doubt!

Kd-Here commented 1 year ago

@fms12 please review and let me know if you have other similar tasks.

fms12 commented 1 year ago

pass these checks

fms12 commented 1 year ago

For example, So your directory structure could be like this;

- DATA-STRUCTURE-AND-ALGORITHM-IN-PY
   -  LinkedList
       - Doubly
       - Singly
       - ReversedSingly     <----------- This will be your newly created folder
           - solution.py       <----------- Write the code for the implementation here
           - test_solution.py <----------- Write a test for it here to make sure it's working

There is already a LinkedList directory, which includes full Doubly and Singly linked list implementation. You can add yours Has a new directory ReversedSingly, then write the solution and test for it there.

Anyone could also add tests for it in the future to learn it.

fms12 commented 1 year ago

click s

Hey @fms12 can you guide me. I want to know how to successfully passed the pytest run by github!

go and click on the details of every pytest. image then you will get the error.

fms12 commented 1 year ago

@devvspaces can you look at this?

devvspaces commented 1 year ago

@devvspaces can you look at this?

Sure I wil

Kd-Here commented 1 year ago

@devvspaces @fms12 I found the reason for failure. It's bcoz of others file which get merged in main before setting the automated pytest. https://pybit.es/articles/linting-with-flake8/ Now we have 2 options we can ignore those error by a ignore script. (I can do this ) Or we can make change in each file.

Let me know what to do.

fms12 commented 1 year ago

@devvspaces @fms12 I found the reason for failure. It's bcoz of others file which get merged in main before setting the automated pytest. https://pybit.es/articles/linting-with-flake8/ Now we have 2 options we can ignore those error by a ignore script. (I can do this ) Or we can make change in each file.

Let me know what to do.

great but I have mentioned a comment in your code just do check it out

devvspaces commented 1 year ago

I will let me check it

Kd-Here commented 1 year ago

Hope this time Mayank it will get merge. I tried each file having error. Can you please run the test.

fms12 commented 1 year ago

Hope this time Mayank it will get merge. I tried each file having error. Can you please run the test.

@Kd-Here you have to add comments in the binary search code .

Kd-Here commented 1 year ago

Hope this time Mayank it will get merge. I tried each file having error. Can you please run the test.

@Kd-Here you have to add comments in the binary search code .

In file binary_search.py? I think we need to change testing part. Because testing part was added after many PR. Which giving error in latest PR. Can you merge my PR. I will try to edit all code later with automated tool.

fms12 commented 1 year ago

Hope this time Mayank it will get merge. I tried each file having error. Can you please run the test.

@Kd-Here you have to add comments in the binary search code .

In file binary_search.py? I think we need to change testing part. Because testing part was added after many PR. Which giving error in latest PR. Can you merge my PR. I will try to edit all code later with automated tool.

all things are good just add comment in your code "Binary search tree code "

devvspaces commented 1 year ago

Hi, i am on this now

devvspaces commented 1 year ago

@Kd-Here , this was the first error you got in your PR, it's just a deep source python error. This is the first commit https://github.com/fms12/DATA-STRUCTURE-AND-ALGORITHM-IN-PY/pull/216/commits/4d81a910fcacb5ada7512566cd6db671cdadc6cc

When you started having flake8 problems was here https://github.com/fms12/DATA-STRUCTURE-AND-ALGORITHM-IN-PY/pull/216/commits/9e547ad4ca6a8db165bf921fcb7c92bde18e6a20.

devvspaces commented 1 year ago

I see you have edited others code too, what you can do now, to not worry yourself is this.

  1. Copy the folder that contains just your code. Place is somewhere else, outside of your repo.
  2. Create another repo using fork
  3. Place your folder back to it's position and make a PR, let's start from there.

Reason is this, when i run flake8 now on the current code base there were zero errors. Now i see you have edited a lot of other files, that are now showing error with flake8

devvspaces commented 1 year ago

Do you understand me @Kd-Here

Kd-Here commented 1 year ago

Yes I got it. I will create a PR of only changes in my code.