Skip to content

K-th smallest Element in BST #2172

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

Closed
jay24rajput opened this issue Jul 4, 2020 · 11 comments
Closed

K-th smallest Element in BST #2172

jay24rajput opened this issue Jul 4, 2020 · 11 comments

Comments

@jay24rajput
Copy link

Problem Statement

Adding a function to the BST to find the kth-smallest element in the entire binary search tree. If possible I would also like to extend it to find the kth-largest element in the BST.

Motivation

This problem was asked in Leetcode Challenge. I thought that this will be a good addition( if not absolutely necessary) to the BST functions.

@jay24rajput
Copy link
Author

@cclauss thoughts?

@jay24rajput
Copy link
Author

@Gaushikmr I was kind of hoping to work on it myself once @cclauss or any other mentor approves the functions

@cclauss
Copy link
Member

cclauss commented Jul 10, 2020

Please do not open issues to ask permission or be to assigned. Those are both alien concepts in this repo.

We review pull requests. If you have a good idea then implement it and submit a pull request. If you both submit pull requests on the same algorithm, we might pick one and close the other. Or more likely, we might ask you to work together to create a unified pull request that takes the strengths of each request.

Only our competitors think that we should wait...

@jay24rajput
Copy link
Author

Thanks for the reply! I will issue a PR soon

@cclauss
Copy link
Member

cclauss commented Jul 11, 2020

It would also help readers if you could provide a use case.
When and why would I want to find the k-th smallest element in a binary search tree.

@stale
Copy link

stale bot commented Aug 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Aug 10, 2020
@Gaushikmr
Copy link

@jay24rajput R u working on this issue.if not I can work on it

@stale stale bot removed the stale Used to mark an issue or pull request stale. label Aug 10, 2020
@jay24rajput
Copy link
Author

@Gaushikmr Please go ahead 👍

@Gaushikmr
Copy link

@jay24rajput OK

@SiddhantBobde
Copy link
Contributor

Can I work on this issue?

@cclauss
Copy link
Member

cclauss commented Aug 16, 2020

PLEASE do not ask permission to work on a problem. This repo does not reserve tasks or give permission. If you see something that should be fixed then please submit a pull request and it will be evaluated on its merits. Having two developers submit alternative solutions to a problem is much better than having developers waiting for permission to start working.

SiddhantBobde added a commit to SiddhantBobde/Python that referenced this issue Aug 16, 2020
SiddhantBobde added a commit to SiddhantBobde/Python that referenced this issue Aug 16, 2020
stokhos pushed a commit to stokhos/Python that referenced this issue Jan 3, 2021
…s#2318)

* fixes: TheAlgorithms#2172

* fixes: TheAlgorithms#2172

* Added docstrings and type of parameters

* fixed error

* Added type hints

* made changes

* removed capital letters from function name

* Added type hints

* fixed bulid error

* modified comments

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

No branches or pull requests

4 participants