Skip to content

Commit d2fd111

Browse files
committed
Update comments regarding time and space complexity to clarify
1 parent b399cbb commit d2fd111

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clone-graph/yolophg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Time Complexity: O(N + E) Node + Edge
1+
// Time Complexity: O(N + E) N = Node + E = Edge
22
// Space Complexity: O(N + E)
33

44
var cloneGraph = function (node) {

course-schedule/yolophg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Time Complexity: O(numCourses * E)
1+
// Time Complexity: O(numCourses * E) E = Edge
22
// Space Complexity: O(numCourses * E)
33

44
// initialize an array to keep track of the in-degrees for each course

design-add-and-search-words-data-structure/yoloophg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// AddWord Method : Time Complexity: O(L)/Space Complexity: O(L)
2-
// Search Method : Time Complexity: O(M)/Space Complexity: O(1)
1+
// AddWord Method : Time Complexity: O(L)/Space Complexity: O(L) L = the length of the word being added
2+
// Search Method : Time Complexity: O(M)/Space Complexity: O(1) M = the length of the word being searched
33
// SearchInNode Method : Time Complexity: O(M)/Space Complexity: O(1)
44

55
var WordDictionary = function () {

number-of-islands/yolophg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Time Complexity: O(m * n)
1+
// Time Complexity: O(m * n) m = rows n = cols
22
// Space Complexity: O(m * n)
33

44
var numIslands = function (grid) {

0 commit comments

Comments
 (0)