Java Program to find maximum and minimum occurring character in a string.In this program, we need to count each character present in the string and find out the maximum and minimum occurring character. Grass is greener on the other side In above example, character 'a' is occurred only once in the string. So, it is minimum occurring character and is highlighted by red. Character e has occurred maximum number of times in the entire string i.e. 6 times. Hence, it is the maximum occurring character and is highlighted by green. ALGORITHM
Program:Output: Minimum occurring character: a Maximum occurring character: e Next TopicJava Programs |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India