1. Home
  2. Algorithms

Filters

Found 2 Questions

Set Default
Subjects
Topics

List of top Algorithms Questions on Algorithm design techniques

Consider the string abbccddeee. Each letter in the string must be assigned a binary code satisfying the following properties:
1. For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter. 
2. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter. 
Among the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?

  • GATE CS - 2021
  • GATE CS
  • Algorithms
  • Algorithm design techniques
Define \(R_n\) to be the maximum amount earned by cutting a rod of length \(n\) meters into one or more pieces of integer length and selling them. For \(i>0\), let \(p[i]\) denote the selling price of a rod whose length is \(i\) meters. Consider the array of prices:
\[ p[1]=1,\; p[2]=5,\; p[3]=8,\; p[4]=9,\; p[5]=10,\; p[6]=17,\; p[7]=18 \] Which of the following statements is/are correct about \(R_7\)?
  • GATE CS - 2021
  • GATE CS
  • Algorithms
  • Algorithm design techniques
contact us
terms & conditions
Privacy & Policy
© 2026 Patronum Web Private Limited