1112
you are viewing a single comment's thread
view the rest of the comments
[-] rasensprenger@feddit.de 4 points 1 year ago

Well landau notation only describes the behaviour as an input value tends to infinty, so yes, every real machine with constant finite memory will complete everything in constant time or loop forever, as it can only be in a finite amount of states.

Luckily, even if our computation models (RAM/TM/...) assume infinite memory, for most algorithms the asymptotic behaviour is describing small-case behaviour quite well.

But not always, e.g. InsertionSort is an O(n^2) algorithm, but IRL much faster than O(n log n) QuickSort/MergeSort, for n up to 7 or so. This is why in actual programs hybrid algorithms are used.

this post was submitted on 19 Oct 2023
1112 points (100.0% liked)

196

16445 readers
1789 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS