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

Fixed issue with insert in BinarySearchTree #259

Merged
merged 1 commit into from
Apr 19, 2020

Conversation

Aimaanhasan
Copy link
Contributor

References to other Issues or PRs or Relevant literature

See #235 (comment) of PR #235

Brief description of what is fixed or changed

insert in BinarySearchTree assumes root as 0 and starts with 0 by initializing prev_node as shown below:

new_node, prev_node, flag = TreeNode(key, data), 0, True
.

However, this is not a case if the tree is rotated, root can be changed from 0.

@codecov
Copy link

codecov bot commented Apr 19, 2020

Codecov Report

Merging #259 into master will not change coverage.
The diff coverage is 100.000%.

@@            Coverage Diff            @@
##            master      #259   +/-   ##
=========================================
  Coverage   98.563%   98.563%           
=========================================
  Files           24        24           
  Lines         2228      2228           
=========================================
  Hits          2196      2196           
  Misses          32        32           
Impacted Files Coverage Δ
pydatastructs/trees/binary_trees.py 97.033% <100.000%> (ø)

Impacted file tree graph

Copy link
Member

@czgdp1807 czgdp1807 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, that's a very trivial mistake and I did that. Thanks for fixing.

@czgdp1807 czgdp1807 added bug Something isn't working trees labels Apr 19, 2020
@czgdp1807 czgdp1807 merged commit 8d8e688 into codezonediitj:master Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working trees
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants