Skip to content

Commit 840eef7

Browse files
Merge pull request #56 from wakidurrahman/feat/big-O-complexities-01
log
2 parents 05c6fec + f751309 commit 840eef7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/big-O-complexities/big-O-complexities-01.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* O(n3) is cubic time.
1515
*
16+
* O(log(n))
1617
* logarithmic time complexity
1718
* is printing elements that are a power of 2 between 2 and n
1819
@@ -57,6 +58,7 @@ const cubicTimeArray = ['a', 'b', 'c', 'd', 'e', 'f'];
5758
console.log(printCubicTime(cubicTimeArray));
5859

5960
/**
61+
* O(log(n))
6062
* The efficiency of logarithmic time complexities is apparent with large inputs such as a million items.
6163
* Although n is a million, exampleLogarithmic will print only 19 items because log2(1,000,000) = 19.9315686.
6264
*/

0 commit comments

Comments
 (0)