0

Can u explain this program i didnt understand this input and output...how s this?

Evaluate the expression and sort and print the output. Getting the input is the tricky part Input: Number of input : 4 2*3 2^2^2 35 3*1 Output: 3*1 2*3 2^2^2 35

10th Jul 2018, 3:10 AM
C Lover
10 Answers
+ 1
I have a guess how this is sorted. If you calculate the arithmetic operations its sorted from min to max.
10th Jul 2018, 5:40 AM
Akib
Akib - avatar
+ 2
Where did you find this?
10th Jul 2018, 3:43 AM
Akib
Akib - avatar
+ 2
It looks like they all shifted down one, and the last one was carried to the beginning.
10th Jul 2018, 4:24 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
+ 1
It looks like it's just scrambling the order of the inputs.
10th Jul 2018, 3:49 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
+ 1
Ben Allen (Njinx) its unclear what the real algorithm is since there is just one example. C Lover Look for the explanation at the site where you found it. It seems pretty weird to me for not explaining this kind of problem more in the question.
10th Jul 2018, 5:38 AM
Akib
Akib - avatar
+ 1
Akib Reza thank u fr the explanation bro
10th Jul 2018, 5:59 AM
C Lover
0
Akib Reza it's Zoho mnc company questions
10th Jul 2018, 3:53 AM
C Lover
0
Ben Allen (Njinx) but how it came ..there will be logic for that expression
10th Jul 2018, 3:54 AM
C Lover
0
Akib Reza I took from geeks for geeks,, this what they given there
10th Jul 2018, 5:55 AM
C Lover
0
2*3=6 2^2^2=16 35=35 3*1=3 Result is sorted in ascending order 3*1=3 2*3=6 2^2^2=16 35=35
7th May 2019, 12:55 PM
malathy