We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d8b148 commit a170795Copy full SHA for a170795
src/big-O-complexities/big-o-rule.ts
@@ -73,4 +73,31 @@ function coefficientRuleOneTwo(limit: number) {
73
74
/**
75
* 2. Sum Rule
76
+ * Imagine a master algorithm that involves two other algorithms.
77
+ * The Big-O notation of that master algorithm is simply the sum of the other two Big-O notations.
78
+ */
79
+
80
+function sumRule(boxes: string[], items: number[]) {
81
+ // For boxes iteration
82
+ boxes.forEach(element => {
83
+ // O(n)
84
+ console.log(element);
85
+ });
86
87
+ // For items iteration
88
+ items.forEach(element => {
89
90
91
92
+}
93
94
+/**
95
+ * BIG O Calculation
96
+ * O(n + n)
97
+ * O( a + b )
98
99
100
101
+ * Product Rule
102
+ *
103
*/
0 commit comments