• 20 October

    Count number of occurrences (or frequency) of each element in a sorted array

    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 count number of occurrences (or frequency) of each element in a sorted array Problem Given a Sorted Array of integers containing duplicates. Find the frequency of every unique element present […]

  • 20 October

    Find subarrays with given sum in an array.

    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 subarrays with given sum in an array. Problem Given an Array of non negative Integers and a number. You need to print all the starting and ending indices of […]

  • 15 October

    Count 1’s in sorted Binary Array

    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 count number of 1’s in sorted binary array. Problem Print number of 1’s in a given sorted Binary Array. For eg:- int[] arr = {0,0,0,1,1,1,1}; output : 4 int[] arr […]

  • Find peak element in the array
    14 October

    Find peak element in the 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 find peak element in the array. Problem Given an array of integers. find the peak element in the array. Peak Element is the element of the array […]