Evaluate the following prefix expression " ++ 26 + - 1324"

Answer Posted / rushi

I see multiple answers to this depending on how you interpret 1324 into 3 numbers i.e. either 1 3 24, 13 2 4, 1 32 4, etc.


1. ++ 26 + - 1324
+(+26) + - 1324 -> +26 becomes 8
+8+(-13 2)4 -> 13 -2 = 11
+8(+11 4) -> 11 +4 = 15
+8 15
= 23

2.++ 26 + - 1324
+(+26) + - 1324 -> +26 becomes 8
+8+(-1 3)24 -> 1 -3 = '-'2
+8(+(-2) 24) -> 24 + -2 = 24 -2 = 22
+8 22
= 30

3.++ 26 + - 1324
+(+26) + - 1324 -> +26 becomes 8
+8+(-1 32)4 -> 1 -32 = '-'31
+8(+(-31) 24) -> -31 + 24 = -7
+8 '-7'
= 1

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of thread?

511


Can we add heterogeneous elements into treemap?

561


Differentiate between file and structure storage structure.

515


Evaluate the following prefix expression " ++ 26 + - 1324" (Similar types can be asked)

583


Why is arraylist faster than linkedlist?

516






Is list same as array?

470


What do you mean by data types?

532


Is bubble sort faster than selection sort?

470


What is sequential mapping in data structure?

465


How do you find a string is anagram or not?

479


How many types of data structure are there?

458


what is Linked lists?

611


What are the four characteristics of algorithms?

474


What is the method to find the complexity of an algorithm?

547


Can you use Bubble Sort To sort the number of elements.

504