Algorithms - Algorithm Design Techniques

41. Consider the polynominal p(x) = a0 + a1x + a2x2 + a3x3, where a1 ≠ 0, ∀i. The minimum number of multiplcations needed to evaluate p on an input x is

  • Option : A
  • Explanation :
    p(x) = a0 + a1x + a2x2 + a3x3
    p(x) = a0 + (Ca3x + a2)x + a)x
    t = cl3* x
    t = t + a2
    t = t * x
    t = t + a1
    t = t * x
    t = t + a0
    So minimum 3 multiplication are needed to e valuate P.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


42. The characters a to h have the set of frequencies based on the first 8 Fibonacci numbers as follows: a : 1, b : 1, c : 2, d : 3, e : 5, f: 8, g : 13, h : 21 A Huffman code is used to represent the characters. What is the sequence of characters corresponding to the following code?
110111100111010

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


43. Which of the follovving is the Huffman code for the letters a, b, c, d, e?

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


44. What is the average length of the correct answer to above question?

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


45. Which of the following statement(s) is/are correct regarding Bellman-Ford shortest path algorithm?
P. Alvvays finds a negative weighted cycle, if one exists.
Q. Finds whether any negative weighted cycle is reachable from the source

  • Option : B
  • Explanation :
    I n Bellman Ford shortest path algorithm, we choose a node first and then we find any negative weighted cycle is reachable from source.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *