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

feat(tree): add go code #29

Merged
merged 6 commits into from
Nov 26, 2022

Conversation

Reanon
Copy link
Contributor

@Reanon Reanon commented Nov 26, 2022

No description provided.

@vercel
Copy link

vercel bot commented Nov 26, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
hello-algo ⬜️ Ignored (Inspect) Nov 26, 2022 at 8:33AM (UTC)

codes/go/pkg/tree_node.go Outdated Show resolved Hide resolved
import "testing"

func TestBinarySearchTree(t *testing.T) {
nums := []int{8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7}
Copy link
Owner

@krahets krahets Nov 26, 2022

Choose a reason for hiding this comment

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

Although we have sort() the array before building the tree, it is recommended to be consistent with the Java version int[] nums = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; to avoid unnecessary ambiguity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in next commit.

Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

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

Thanks for the clean code!

Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

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

Thanks, @Reanon !

@krahets krahets merged commit 62c40fd into krahets:master Nov 26, 2022
@Reanon Reanon deleted the feature/support-go-chapter-tree branch November 26, 2022 08:50
@Reanon Reanon restored the feature/support-go-chapter-tree branch November 27, 2022 01:57
@Reanon Reanon deleted the feature/support-go-chapter-tree branch November 27, 2022 02:03
@krahets krahets added the code Code-related label Dec 3, 2022
@Reanon Reanon changed the title Support go code in chapter-tree feat(tree): add go code Jan 8, 2023
@Reanon Reanon mentioned this pull request Jan 8, 2023
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants