Skip to content

Angele Z.#39

Open
geli-gel wants to merge 3 commits into
Ada-C12:masterfrom
geli-gel:master
Open

Angele Z.#39
geli-gel wants to merge 3 commits into
Ada-C12:masterfrom
geli-gel:master

Conversation

@geli-gel

@geli-gel geli-gel commented Sep 9, 2019

Copy link
Copy Markdown

No description provided.

@CheezItMan CheezItMan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work! You hit all the learning goals here. Do take a look at my comment on the time complexity of binary search. Well done.

# Returns true if found, false otherwise.
# Time complexity: ?
# Space complexity: ?
def search(array, length, value_to_find)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Big-O?

# Returns true if found, false otherwise.
# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n log(n))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since we cut the items to search in half with each iteration and we never have to progress through each element.

So this is O(log n) and not O(n log n)

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