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

Branches-Steph #48

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

Branches-Steph #48

wants to merge 3 commits into from

Conversation

Steph0088
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

I'm glad you got this in. A few minor mistakes in a few of the methods here. Take a look at my suggestions and let me know if you have questions.

def binary_search(array, length, value_to_find)
raise NotImplementedError
bigger = array.length - 1

Choose a reason for hiding this comment

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

In restricted Array, length is not a method. It's a parameter passed in.

Suggested change
bigger = array.length - 1
bigger = length - 1

bigger = array.length - 1
smaller = 0
while bigger >= smaller
middle = (high + low) / 2

Choose a reason for hiding this comment

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

You need to define high and low here before the loop starts. Maybe use smaller and bigger.

Suggested change
middle = (high + low) / 2
middle = (bigger + smaller) / 2

while i < length
if array[i] < smallest
smallest = array[i]
i += 1

Choose a reason for hiding this comment

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

You don't want to do this twice in the while loop.

Suggested change
i += 1

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.

2 participants