-
Notifications
You must be signed in to change notification settings - Fork 313
Added LCA and tests #88
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
Changes from 11 commits
36de7f2
b894bce
8dd5d23
814daad
f9099ba
994e267
94817e0
a53d277
00ad7f7
f997c53
3fa3760
e37ee7d
94d879c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -415,6 +415,141 @@ def rank(self, x): | |||||
| walk = p | ||||||
| return r | ||||||
|
|
||||||
| def _simple_path(self, key, root): | ||||||
| """ | ||||||
| Utility funtion to find the simple path between root and node. | ||||||
|
|
||||||
| Parameter | ||||||
| ========= | ||||||
|
|
||||||
| key: | ||||||
| key of the node to be searched | ||||||
|
|
||||||
| Returns | ||||||
| ======= | ||||||
|
|
||||||
| bool: | ||||||
|
||||||
| bool: | |
| path[::-1]: bool |
czgdp1807 marked this conversation as resolved.
Show resolved
Hide resolved
czgdp1807 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A value error would have been better to let the user know that they are searching for garbage values.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key may not always be an integer. So, this conflicts with the doc string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key: Python objectThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't addressed.