You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functioncompressBoxesTwice(boxes,boxes2){boxes.forEach(function(boxes){console.log(boxes);});boxes2.forEach(function(boxes){console.log(boxes);});}// X: O(n)// O: O(a + b), O(n + m) -> you can name it whatever you want
4. Drop Non Dominants
functionprintAllNumbersAndPairSums(numbers){console.log("these are the numbers: ");numbers.forEach((number)=>{console.log(number);});console.log("and these are their sums: ");numbers.forEach((firstNumber)=>{numbers.forEach((secondNumber)=>{console.log(firstNumber+secondNumber);});});}printAllNumbersAndPairSums([1,2,3,4,5]);// X: O(n + n^2)// O: O(n^2) -> only leave the most significant part
About
a repository to study data structures and algorithms