Open hyunsik-yoon opened 1 year ago
func(arr1, arr2) {
foreach arr1 ...
foreach arr2 ...
}
Big O of the above is O(n+m) since we don't know if n is dominant or m is dominant.
Likewise,
func(arr1, arr2) {
foreach arr1 ...
foreach arr2 ...
}
Big O of the above is O(n*m)
Let's write them down.