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
bce19ef9
Commit
bce19ef9
authored
1 year ago
by
Dominik Zobel
Committed by
Tobias Koelling
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add selection of time complexities
parent
ca8273c3
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
+17
-6
17 additions, 6 deletions
lectures/complexity/slides.qmd
with
17 additions
and
6 deletions
lectures/complexity/slides.qmd
+
17
−
6
View file @
bce19ef9
...
@@ -15,7 +15,7 @@ Amount of resources needed for algorithms working on data structures
...
@@ -15,7 +15,7 @@ Amount of resources needed for algorithms working on data structures
- Time to run an algorithm with given data size
- Time to run an algorithm with given data size
- Often main focus of complexity analysis
- Often main focus of complexity analysis
**Space Complexity**
**Space Complexity**
- Memory required to run an algorithm with given data size
- Memory required to run an algorithm with given data size
...
@@ -34,6 +34,22 @@ Amount of resources needed for algorithms working on data structures
...
@@ -34,6 +34,22 @@ Amount of resources needed for algorithms working on data structures
| quadratic | $\mathcal{O}(n^2)$ |
| quadratic | $\mathcal{O}(n^2)$ |
## Selection of Time Complexities
:::{.smaller}
Data structure Access Insert/Delete Search
--------------- ----------------------- ------------------------------------- -------------------------------------
Array $\mathcal{O}(1)$ $\mathcal{O}(n)$ $\mathcal{O}(n)$
Linked list $\mathcal{O}(n)$ $\mathcal{O}(1)$ $\mathcal{O}(n)$
Hash table --- $\mathcal{O}(1)$ -- $\mathcal{O}(n)$ $\mathcal{O}(1)$ -- $\mathcal{O}(n)$
Tree[^1] $\mathcal{O}(\log{n})$ $\mathcal{O}(\log{n})$ $\mathcal{O}(\log{n})$
[^1]: Some types of trees have $\mathcal{O}(\log{n})$ -- $\mathcal{O}(n)$ for insert/delete and search
:::
# specific algorithms
# specific algorithms
* sorting (e.g. bubble, quick, merge, bogo... [idea instructions](https://idea-instructions.com))
* sorting (e.g. bubble, quick, merge, bogo... [idea instructions](https://idea-instructions.com))
...
@@ -41,11 +57,6 @@ Amount of resources needed for algorithms working on data structures
...
@@ -41,11 +57,6 @@ Amount of resources needed for algorithms working on data structures
* bisect (?) (ref to `git bisect`)
* bisect (?) (ref to `git bisect`)
## Revisiting arrays and linked-lists
- Access time
- Searching
# models of computation
# models of computation
...
...
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