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

Stacks Big-O(livia) #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Stacks big-O(livia)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1. o(n) Linear - We iterate over every element in the array.
2. o(n) Linear - There are two, un-nested loops here, so we'll add instead of mult.
3. o(1) Constant - Because we're only checkig one element.
4. o(n2) Quadratic - We have two loops here, one nested and we'll have to iterate through both.
5. o(n * m) - There are two linear loops here, independent of each other.
6. o(n) Linear - Once through the array.
7. o(n2) Quadratic - Since we have to loop, then loop again (potentially to the end) to check against each one.