Java Program for Cycle Sort
Cycle sort is an in-place sorting Algorithm, unstable sorting algorithm, a comparison sort that is theoretically optimal in terms of the total number of writes… Read More »
Cycle sort is an in-place sorting Algorithm, unstable sorting algorithm, a comparison sort that is theoretically optimal in terms of the total number of writes… Read More »
Given two integers n and k. Find position the n’th multiple of K in the Fibonacci series. Examples: Input : k = 2, n =… Read More »
We have N coins which need to arrange in form of a triangle, i.e. first row will have 1 coin, second row will have 2… Read More »
Given two integer numbers, the task is to find the count of all common divisors of given numbers? Input : a = 12, b =… Read More »
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. Java filter_none edit close play_arrow link… Read More »
Given a range [n, m], find the number of elements that have odd number of factors in the given range (n and m inclusive). Examples:… Read More »
Given a number x, determine whether the given number is Armstrong number or not. A positive integer of n digits is called an Armstrong number… Read More »
BogoSort also known as permutation sort, stupid sort, slow sort, shotgun sort or monkey sort is a particularly ineffective algorithm based on generate and test… Read More »
This is basically a variation of bubble-sort. This algorithm is divided into two phases- Odd and Even Phase. The algorithm runs until the array elements… Read More »
Algorithm Steps If you are at the start of the array then go to the right element (from arr[0] to arr[1]). If the current array… Read More »
Cocktail Sort is a variation of Bubble sort. The Bubble sort algorithm always traverses elements from left and moves the largest element to its correct… Read More »
Bitonic Sequence A sequence is called Bitonic if it is first increasing, then decreasing. In other words, an array arr[0..n-i] is Bitonic if there exists… Read More »
Bitonic Sequence A sequence is called Bitonic if it is first increasing, then decreasing. In other words, an array arr[0..n-i] is Bitonic if there exists… Read More »
Given a number “n”, find its total number of divisors is even or odd. Examples: Input: n = 10 Output: Even Input: n = 100… Read More »
Pigeonhole sorting is a sorting algorithm that is suitable for sorting lists of elements where the number of elements and the number of possible key… Read More »