Arrange the following prefix expressions by value in increasing order: 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
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)⁵ = 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 binary tree? A. It has always odd number of vertices. B. With i internal vertices, it has i+…
- Which of the following is TRUE?
- 2-3-4 trees are B - trees of order 4. They are isometric of trees.
- Match List I with List II. List I: A. Parallel FFT, B. Iterative FFT, C. Evaluation of a polynomial at n points by Horner's method, D. Prod…
- Let f(n) and g(n) be asymptotically positive functions. Statement I: f(n) ≥ 1 and f(n) = O(g(n)) ⇒ g(n) = Ω(f(n)). Statement II: f(n) = O(g…
- A. If some NP-complete problem P is in 𝒫, then 𝒫 = 𝒩𝒫. B. TSP is in 𝒩𝒫. C. SAT is in 𝒩𝒫. D. The Hamiltonian circuit problem is not NP-compl…