In this article, we will check whether a given Number is an Armstrong Number or Not. Armstrong Number An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. There are just four 3-digit numbers which are the …
Continue reading Java program to check if a number is Armstrong numberJava Programs
In this article, we will write a program to check if a number is prime or not. Prime Number A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, 2, 3,5,7,11,13,… are prime numbers since they are only divisible by …
Continue reading Java program to check if a number is prime or notSorting algorithms: A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Arrays class in the Java collections framework defines overloaded sort() methods to sort arrays of primitive data types and objects. Similarly, we can …
Continue reading Top 10 Sorting algorithms in JavaIn this article, we will cover Radix sort algorithm in java. Radix sort Radix sort algorithm sorts data with integer keys by grouping keys by the individual digits which share the same significant position and value. Rather than directly applying bucket sort to a set of elements, this performs bucket sorting the …
Continue reading Radix sort in javaIn this article, we will discuss counting sort algorithm implementation in java. Counting Sort algorithm The algorithm loops over the items, computing the number of times each key occurs within the array. Then for each key, it determines the starting position in the output array of the items having that key. Then …
Continue reading Counting sort in java