Letters Differentiator

Another differentiator…pretty naive and letter by letter comparison…complexity is O(n)….pretty bad!!! Somehow I am not able to find a better way to do it… package textManipulate; /** * Finds the difference between the letters of two texts using Recursion * @author sphukan * */ public class lettersDifference { int count=0; int differentiate(String text1,String text2){ if … Continue reading

Frequency Finder

Heres another interesting one….finds out the frequency of letters in a line of text using recursion and Java collections….I am sure the same can be done without employing collections…but then I kinda like em….!!! package textManipulate; import java.util.HashMap; import java.util.Map; public class Frequency { static Map<String,Integer> map=new HashMap<String,Integer>(); public static void main(String[] a){ Frequency freq=new … Continue reading

Repetitive Letters Remover

Heres a small chunk of code to start with. This code removes repetitive letters from a line of text using recursion. package textManipulate; /** * Removes repetitive letters from a string using recursion * @author sphukan * */ public class RepetitionRemover { String removeit(String text){ if (text.length()==1) return text; else { //Get the next letter … Continue reading