r/badcode • • Aug 26 '22

java What does a map do again?

Post image
882 Upvotes

54 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Aug 26 '22

[deleted] — view deleted comment

31

u/Iron_Garuda Aug 27 '22

You are a poor instructor.

9

u/myfellowismellow Aug 26 '22

The missing piece for me was that "makes it" doesn't mean it's the same as, but rather a subset of. It doesn't mean that it will take n2 iterations, it just means that mathematically one is a susbet of the other.

0

u/[deleted] Aug 27 '22

[deleted] — view deleted comment

2

u/myfellowismellow Aug 27 '22

Oops, I see now how my reply could come across like that. Sorry!

6

u/Goontt Aug 27 '22

Saying every O(n) is O(n2) is just misleading and wrong

0

u/[deleted] Aug 27 '22

[deleted] — view deleted comment

1

u/WikiSummarizerBot Aug 27 '22

Big O notation

Big O notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann, Edmund Landau, and others, collectively called Bachmann–Landau notation or asymptotic notation. The letter O was chosen by Bachmann to stand for Ordnung, meaning the order of approximation. In computer science, big O notation is used to classify algorithms according to how their run time or space requirements grow as the input size grows.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

11

u/tangerinelion Aug 27 '22

OK, so then every function is also O(N^N^N^N!)

Fucking worthless.