File tree 4 files changed +5
-5
lines changed
design-add-and-search-words-data-structure
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- // Time Complexity: O(N + E) Node + Edge
1
+ // Time Complexity: O(N + E) N = Node + E = Edge
2
2
// Space Complexity: O(N + E)
3
3
4
4
var cloneGraph = function ( node ) {
Original file line number Diff line number Diff line change 1
- // Time Complexity: O(numCourses * E)
1
+ // Time Complexity: O(numCourses * E) E = Edge
2
2
// Space Complexity: O(numCourses * E)
3
3
4
4
// initialize an array to keep track of the in-degrees for each course
Original file line number Diff line number Diff line change 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
3
3
// SearchInNode Method : Time Complexity: O(M)/Space Complexity: O(1)
4
4
5
5
var WordDictionary = function ( ) {
Original file line number Diff line number Diff line change 1
- // Time Complexity: O(m * n)
1
+ // Time Complexity: O(m * n) m = rows n = cols
2
2
// Space Complexity: O(m * n)
3
3
4
4
var numIslands = function ( grid ) {
You can’t perform that action at this time.
0 commit comments