Javascript – Why does this function with random arguments always hit the base case the same number of times?
I want to determine the time complexity of the below code 👇 function random(a){ let i; let num=Math.floor((Math.random()*(a+1))) return num; } function fuc1(n){ let i; if(n<=0){ alert("condition false ") return 0; }else{ i=random(n-1); console.log("thisn") return fuc1(i)+fuc1(n-1-i); } } fuc1(6) I…