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

Solução final #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

leaomatheus
Copy link

Acho que é a solução final, mas se puder ter algum code review iria ser bom!

Copy link
Owner

@PauloAguiar PauloAguiar left a comment

Choose a reason for hiding this comment

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

Lab OK!

@@ -30,3 +30,14 @@ type Nodes []*Node
func (n Nodes) Len() int { return len(n) }
func (n Nodes) Swap(i, j int) { n[i], n[j] = n[j], n[i] }
func (n Nodes) Less(i, j int) bool { return n[i].HashId < n[j].HashId }

// LowerBound assumes array is sorted
func (n Nodes) LowerBound(val uint32) int {
Copy link
Owner

@PauloAguiar PauloAguiar Oct 19, 2016

Choose a reason for hiding this comment

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

Nitpicking: o nome ficou meio confuso. No começo eu achei que dado um valor, você ia retornar o elemento do anel que é o lower bound (o que estaria incorreto), mas na verdade você retorna o elemento para o qual val é lower bound.

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

Successfully merging this pull request may close these issues.

None yet

2 participants