Arrange the following prefix expressions in increasing order of their values:
A. + − * 2 / 8 4 3 2
B. ↑ − * 3 3 * 4 2 5
C. + − ↑ 3 2 ↑ 2 3 / 6 − 4 2
D. * + 3 + 3 ↑ 3 + 1 1 3
Choose the correct answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. B, A, C, D
Explanation
A = (2·(8/4) − 3) + 2 = 3. B = (3·3 − 4·2)↑5 = 1. C = (3² − 2³) + 6/(4 − 2) = 4. D = (3 + (3 + 3^(1+1))) × 3 = 45. Increasing: B, A, C, D.More Data Structures and Algorithms questions
- Which of the following are true for a complete (full) binary tree? A. It always has an odd number of vertices. B. With i internal vertices,…
- In a ______ the left and right subtrees of some node differ in height by more than one.
- FFTs are ______ techniques used to encode digital video and audio information and help analyse the signal in the ____ domain.
- Given six weights 4, 15, 25, 5, 8, 16, construct a 2-tree (extended binary tree) with minimum weighted path length. What is the minimum wei…
- Suppose we store n keys in a hash table of size m = n² using a hash function h chosen randomly from a universal class of hash functions. Th…
- Which of the following rotations are correctly explained in the context of an AVL tree? A. LL rotation: the new node is inserted in the lef…