Showing posts with label Replace every element of the array by product of all other elements. Show all posts
Showing posts with label Replace every element of the array by product of all other elements. Show all posts

Sunday, 8 November 2020

Replace every element of the array by product of all other elements

Replace every element of the array by product of all other elements

 For example : Consider an array as shown below


If you want to implement the above logic using O(n) space, you can do it only using recursion.

Solution can be found at

https://www.techiedelight.com/replace-element-array-product-every-element-without-using-division-operator/


Recursion tree is as follows