function
PrintRecursive(str, arr, i, n, res, j, len, ln)
{
if
(j==len)
{
res[j];
console.log(res);
return
;
}
if
(j%2==0)
{
res[j] = arr[i].toString();
PrintRecursive(str,arr,i+1,n,res,j+1,len,ln);
}
else
{
for
(let k = 0; k < ln; k++)
{
res[j] = str[k];
PrintRecursive(str,arr,i,n,res,j+1,len,ln);
}
}
}
function
PrintExpressions(n)
{
let str = [
'+'
,
'-'
,
'/'
,
'*'
];
let ln=str.length;
let a = [];
for
(let i = 0; i < n; i++)
{
a.push(0);
a[i] = i + 1;
}
let res = [];
for
(let i = 0; i < ( 2 * n ) - 1; i++)
{
res.push(
''
);
}
PrintRecursive(str, a, 0, n, res, 0, 2*n-1, ln);
return
;
}
let n = 2;
PrintExpressions(n);