• 09 October

### Find first repeating element in an array of integers

If you want to practice data structure and algorithm programs, you can go through 100+ data structure and algorithm programs. In this post, we will see how to find the first repeating element in array of integers. Problem Find the first repeating element in array of integers. For example: Input: array[] = {10, 7, 8, […]

• 17 February

### Check if Array Elements are Consecutive

If you want to practice data structure and algorithm programs, you can go through 100+ data structure and algorithm programs. In this post, we will see how to check if array elements are consecutive. Problem Given an array, we need to check if array contains consecutive elements. For example: Input: array[] = {5, 3, 4, […]

• 26 September

### Print all subarrays of a given array

If you want to practice data structure and algorithm programs, you can go through 100+ data structure and algorithm programs. In this post, we will see how to print all subarrays of given array. Problem Print all print all subarrays of given array. For example: If array is {1,2,3} then you need to print {1}, […]

• 13 August

### Permutations of array in java

If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see how to find all permutations of the array in java. Problem 1 Given array of distinct integers, print all permutations of the array. For example: array : [10, 20, 30] Permuations are : […]

• 20 January

### Java program to find largest number in array

In this tutorial, Java program to find the largest number in array. Here is simple algorithm to find larget element in the array. Initialize lrg with arr[0] i.e. first element in the array. If current element is greater than lrg, then set lrg to current element. [crayon-62b8d3541a1ce120108129/] Output: Enter Array Size : 5 Enter Array […]

• 20 January

### Java program to find minimum value in array

In this tutorial, Java program to find minimum value in an array. Here is simple algorithm to find minimum value in the array. Initialize sml with arr[0] i.e. first element in the array. If current element is less than sml, then set sml to current element. [crayon-62b8d3541bda2325335984/] Output: Enter array Size : 3 Enter array […]

• 24 December

### Linear search in java

If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see about linear search in java. Linear search is simple sequential search in which target element is searched one by one in the array. If element is found in the array then index […]

• 15 October

### Kadane ‘s Algorithm in java

If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. Kadane algorithm is a famous algorithm to solve maximum subarray problem. Maximum subArray problem: From Wikipedia : In computer science, the maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers […]

• 23 August

### Sort array in java

In this post, we will see how to sort an array in java. There are various ways to sort array in java. You can implement different sorting algorithms to sort an array. You can use Arrays.sort method to sort array in java. There are various overloaded versions of Arrays.sort method. You can go through it […]