I always face difficulty when i want multiple returns from single function.For eg:- You all now there is famous problem known as Maximum-subarray Problem(i.e contiguous subarray whose sum is maximum).
I was doing this question from divide and conquer approach. And i want left index,right index of maximum sum contiguous subarray and its sum also.
So Is there any way to handle this problem so that i can take all these information . I can’t return multiple values from function. And i saw at so many places in Pseudo code they write multiple values to be return . But its too difficult to convert such pseudo codes in real codes
Now i am going to give example of those Pseudo code which are given in C.L.R.S book(cormen) and i find myself in very difficult situation to code them
- I have already explained Maximum subarray problem .(in which they returned multiple values).
- Strassen’s algorithm for matrix multiplication using divide and conquer.
So any suggestions plz.
How can i improve myself regarding this.