You optimize your algorithms to O(n log n) right? RIGHT?

You optimize your algorithms to O(n log n) right? RIGHT?

Attached: big-o-graph.png (2448x1546, 60K)

Other urls found in this thread:

goodreads.com/quotes/1188397-bad-programmers-worry-about-the-code-good-programmers-worry-about
godbolt.org/g/7XYGHD
en.wikipedia.org/wiki/Halting_problem
youtube.com/watch?v=rVlhMGQgDkY
twitter.com/SFWRedditImages

O(n) or bust

no, I optimize my algorithms to O(n log(log n)) or below

O(1) or bust

what the best algoritm to sort 4(four) values?

Literal God here, creator of this gay universe, I opted in for Quantum Bogo Sort LOL! Works like charm! Highly recommend.

Attached: proxy.duckduckgo.com.jpg (474x266, 26K)

>he doesn't intentionally trigger every autist with n^2 algorithms and defends them with "But modern hardware is so fast anyways it doesnt matter lmao"

You proof your algortihms and coding thinking in compute architecture.

ok user sort a list in O(n log n ) then. ill wait

How do I know which one I have?

Good programmers write stuff that scales
Average programmers don't care
Bad programmers don't know

[citation needed]

Good programmers use the right tool for a job

goodreads.com/quotes/1188397-bad-programmers-worry-about-the-code-good-programmers-worry-about

Completely unrelated quote /* which is a good quote */
Lots of people like pretending they have scaling issues

>yfw when you realize O(10000000000n) is exactly equivalent to O(n)
>computer science
>confusing humans since 1960

Attached: 20.jpg (720x408, 181K)

Bogosort

unironically bubble sort

Brainlet cant understand the difference between scaling based on input and number of operations

Min and Max sequence, O(1).

3 if statements

>O(sin n)

Attached: .jpg (950x633, 102K)

I have no idea what any of that means

OP is a 300k-starting-CS-major, don't believe her, optimize for cache size

I know, right

>her
Also is "300k starting" is a meme here or did you just localized the Russian "freelancer 300k/mo" meme?

300k starting is a math major meme you newb

Quick, what's the time complexity of

s = 0
for i from 0 to n do
for j from 0 to 1000 do
for k from 0 to i do
s += 1

I remember seeing is on slav 2ch for as long as I can remember, which is starting circa 2009.

O(1) because it will get optimized by any half decent compiler

Noo!!! You are not allowed to make assumptions like that!

Sure, but then give me the equivalent O(1) algo.

This, or if you are using c++
template
void sort(std::array& a) {
// insertion sort
for(auto i = a.begin(); i+1 != a.end(); ++i) {
auto min = i;
for(auto it = min+1; it != a.end() ; ++it) {
if (*it < *min) {
min = it;
}
}
std::swap(*min, *i);
}
}


It unrolls the loops and ends up the same for n=4.

return (n < 0 ? 0 : (n*n-n)*500);

s = 1001 * (n + 1) * (n + 2) /2

O(n2) ?

gcc can't optimize it and leaves a loop in. clang optimizes it just fine.

Which flags?

>when you optimize an O(n logn) to O(n) but it requires 1TB of ram

godbolt.org/g/7XYGHD

Somehow -O3 makes it even way worse. Of course -O1 doesn't work either. Are there some experimental optimization flags which are disabled by default on all optimization levels?

Interesting

Doesn't work for n=1 if you assume that the loops are inclusive on both sides.

>O(tan n)

Attached: 1530148986915.png (1440x1440, 827K)

>If the order is smaller it runs faster hur dur durrrrrr
>Coefficients don't exist!

I'll only give a shit for n > 10e3

And anyone who disagrees is a sperg who doesn't write code.

>every algorithm needs to scale
no

>not precomputing everything for O(1)
It's like he dosen't have 4 exabytes of storage lol.

>10e3
>not 1e4

obviously my result is for exclusive ranges [start, end)

O(∞)

Attached: Untitled-2.jpg (1080x720, 186K)

>ever caring at all
VIRGIN SPERG

>O(i^n)

Attached: 1b9.jpg (640x539, 43K)

Isn't that just O(n)

Explain

It works then.

It's worst case, so O(n) is equivalent to O(infinity times n)

What if it's infinity times n^2?

>t unrolls the loops and ends up the same for n=4.
C do the same, without stuped useless shit

Most problems can be done in N time, optimizing to log(N) is almost pointless for most of my use cases and is often impossible.

not

There exist mathematical proves that show that you can optimize any algorithm to O(n)

>""""""""""""""""""""""""""""""""optimizing"""""""""""""""""""""""""""""""" to O(logn)
Keep ignoring those coefficients! Maybe one day they'll really disappear!

No, it doesn't, unless you inline the algorithm or implement in with some stupid ass macro, so it works with fixed size arrays. You can't write a function in C that takes in a fixed size array and sorts it by unrolling the loops.

When I go to interview and the whiteboard is rolled out I just solve the travelling salesman problem for them in O(log n) time. Gets me the job every time.
Bet you kids can't even do it in O(n) time.

How so? Throw more space?

not

>Not solving it in O(1)
What the you, brainlet?

i say (You) more:
mashine cannot pruve anything about mashine
human(stuped monkey cannot even win in chess) cannot pruve anything about mashine even sure
----------------------------------
Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program-input pairs cannot exist. A key part of the proof was a mathematical definition of a computer and program, which became known as a Turing machine; the halting problem is undecidable over Turing machines. It is one of the first examples of a decision problem.
en.wikipedia.org/wiki/Halting_problem

I solve sparse linear systems in O(n)

"Compures Scaince" it somethink like rat`s scaince about humans
Computer can have Human Scaince but not opposite

The halting problem for Turin machines is undecidable by Turing machines, a stronger computational model might exist in theory.

But humans are significantly smarter then computers?
A human can simulate a computer, the reverse isn't possible.

also, google, stop asking stuper humans about street signs
you know it mach beter than shaved monkeys

>stronger computational model might exist in theory.
the cristmas chicken who shit gold also might exist in theory.

only shaved monkeys can do with computer- worksip it
computer - superior over human

I'm not saying it's likely and I pretty much assume it doesn't exist, but there is no mathematical proof fo its non existence yet.

win the f-cking chess at 1st

I'm not saying it's likely and I pretty much assume it doesn't exist, but there is no mathematical proof fo its non existence of the cristmas chicken who shit gold yet.

Oh wow.
Computers have always been good at *this one thing*.
That doesn't mean they are smart, the exact same algorithm can be executed by a human just a billion times slower.

Meanwhile getting a robot to walk like a human is enormously complicated, intelligence means being good at a range of things and being able to adapt.

*blocks your path*

Attached: o2.png (687x161, 17K)

if Computers can not do something, it cose dont have the programm YET

What's your point? In CS we try to find truths that are as objective as possible. This is not like religion where people donate to churches and the churches are excempt from taxes because of some unverifiable belief.

The way you argue I yould also say that P != NP, because it seems very unlikely. Still a proof is better than intuition.

dno I just use the one npm gives me

Yeah. That is why they are dumb.

Again. A human can simulate a computer, a computer is a REALLY DUMB MACHINE which just can make many dumb things in a short amount of time.
We build these fucking things, there is no mystery about how they work, meanwhile we have basically no clue how our brains work.

>O(n log n)
log n - it working time of binary search, the only algoritm than can undestud the "computer scentists"

You can approximate that though, I believe O(n log n) is possible, but don't quote me.

>This is not like religion where people donate to churches and the churches are excempt from taxes because of some unverifiable belief.

What I mean is, that doubt doesn't really cost us anything, we should always try to look for a proof if we can.

>A human can simulate a computer
A computer can simulate a human, but faster and can copy itself
Need time about 27 year till computer get PhD

>>A human can simulate a computer
>A computer can simulate a human, but faster and can copy itself
>Need time about 27 year till computer get PhD
Lol.
You are seriously clueless, sci-fi isn't reality.

>unverifiable belief.
Are you saying mathematics isn't based on unverifiable beliefs?

>Coppersmith–Winograd algorithm with a complexity of O(n^2.376)
>slightly improved in 2013 by Virginia Vassilevska Williams (exponent 2.3729)
>The largest known lower bound for matrix-multiplication complexity is Ω(n^2 log(n)).

(You) can find only 60 faces per minut
Computer can find 500000 faces per minut

this:

It won't work because n is undefined

But that is directly.
I talked about Approximately solving it.

Shut the fuck up pajeet and please kill yourself

Attached: 1507319832154.jpg (602x603, 63K)

"Compures Scaince" it somethink like rat`s scaince about humans
Computer can have Human Scaince but not opposite

Attached: c0rmTJpFrhA.jpg (490x636, 42K)

>(You) can find only 60 faces per minut
>Computer can find 500000 faces per minut
I can walk.
A computer can barely manage a robot to walk.

that

Yeah. With your IQ that is true.

i say (You) more:
mashine cannot pruve anything about mashine
human(stuped monkey cannot even win in chess) cannot pruve anything about mashine even sure
----------------------------------
Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program-input pairs cannot exist. A key part of the proof was a mathematical definition of a computer and program, which became known as a Turing machine; the halting problem is undecidable over Turing machines. It is one of the first examples of a decision problem.
en.wikipedia.org/wiki/Halting_problem

Attached: ussr_2b.gif (300x100, 302K)

youtube.com/watch?v=rVlhMGQgDkY