Big O notation
Në shqip: Shënimi Big O
ShpjegimiSQ
Big O tregon si rritet koha (ose memoria) që i duhet një algoritmi kur rriten të dhënat. O(1) do të thotë gjithmonë njësoj shpejt, O(n) rritet njësoj me të dhënat, O(n²) rritet shumë shpejt. Pyetet shpesh në intervistat teknike.
EnglishEN
Big O describes how the time (or memory) an algorithm needs grows as the data grows. O(1) means always equally fast, O(n) grows in step with the data, O(n²) grows very quickly. It comes up a lot in technical interviews.
Si ta mendosh
Si ta gjesh një nxënës: nëse e di numrin e bankës, shkon direkt (O(1)); nëse pyet një nga një, zgjat sa ka nxënës (O(n)).
Lexoje në anglisht
Like finding a student: if you know their desk number, you go straight there (O(1)); if you ask each one in turn, it takes as long as there are students (O(n)).