Java Program to Count the Frequency of Each Vowel in a Given String

Write a program to count the frequency of each vowel in a given string in Java. For example, Input “My name is John Smith” Output Number of ‘a’ = 1  Number of ‘e’ = 1   Number of ‘i’ = 2  Number of ‘o’ = 1  Number of ‘u’ = 0 Steps Let str be the input string. Initialize an integer array of size 5. Let the name of the array be cnt. Fill cnt with …

Java Program to Count the Frequency of Each Vowel in a Given String Read More »

Bozo-Sort

Bozo-Sort is a variation of Bogosort. It is another highly inefficient randomized algorithm based on the trial and error approach. Bozo-sort sorts the input list by repeatedly swapping 2 random elements of the list and checking if the list is sorted or not. The process is repeated till the input list is sorted. Implementation In …

Bozo-Sort Read More »

Bogosort

Bogosort is just another sorting algorithm. Bogosort is highly inefficient compared to other sorting algorithms. It is a randomized algorithm and is based on the trial and error paradigm. Bogosort basically generates random permutations of the input list and check if the list is sorted or not. This process is continued until the input list …

Bogosort Read More »