Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
generic software skills
lecture materials
Commits
870fbf57
Commit
870fbf57
authored
1 year ago
by
Tobias Koelling
Browse files
Options
Downloads
Patches
Plain Diff
binary search reword
parent
8bb4b65f
No related branches found
No related tags found
1 merge request
!24
complexity lecture
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lectures/complexity/slides.qmd
+4
-3
4 additions, 3 deletions
lectures/complexity/slides.qmd
with
4 additions
and
3 deletions
lectures/complexity/slides.qmd
+
4
−
3
View file @
870fbf57
...
@@ -569,9 +569,10 @@ None
...
@@ -569,9 +569,10 @@ None
## Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
## Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
1. Create an array `x_values` with at least 4000 equally distributed elements ranging from -2.0 to 2.0
1. Create an array `x_values` with at least 4000 equally distributed elements ranging from -2.0 to 2.0
2. Starting from the left end (-2.0), implement a binary search to find the highest value $x$ in the array `x_values`,
2. Implement a binary search.
for which $f(x) > 0$. How many steps and checks are necessary to find $x$?
3. Find the highest value $x$ in the array `x_values` for which $f(x) > 0$.
3. How many steps would be necessary if `x_values` contained 4100 values? And for 3900?
4. How many steps and checks are necessary to find $x$?
5. How many steps would be necessary if `x_values` contained 4100 values? And for 3900?
# Takeaway
# Takeaway
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment