Tuesday, April 2, 2013

String Algorithm Questions


  1.  Implement the algo to determine if a string has all unique characters. What is you cannot use additional data structure ?
  2. Implement the string reverse function.
  3. Given two string determine one is permutation of another.
  4. Implement the method to perform basic string compression techniques by using the count of repeated character. For example "aabbbccdddde" can be represented as "a2b3c2d4e1". If compressed string is not smaller than original string then return the original string.
  5. Write a code to check if string s1 is rotation of string s2.(eg. "hello" is rotation of "llohe" ). you have given method "substring" which check one word is substring of another. Use it only once to determine it.
  6. Calculate the occurrence of given word in a book.


No comments: