File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
design-add-and-search-words-data-structure Expand file tree Collapse file tree 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
22// Space Complexity: O(N + E)
33
44var 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
22// Space Complexity: O(numCourses * E)
33
44// 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
33// SearchInNode Method : Time Complexity: O(M)/Space Complexity: O(1)
44
55var 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
22// Space Complexity: O(m * n)
33
44var numIslands = function ( grid ) {
You can’t perform that action at this time.
0 commit comments