• 04 February

    LCA of a K-ary Tree in O(Sqrt(height))

    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 how to find Lowest Common Ancestor of a K-ary Tree in O(Sqrt(height)).We have already seen how to find LCA of n-ary tree in O(n) complexity. Problem Given a K-ary tree and […]

  • 03 February

    Largest Rectangular Area in a Histogram

    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 how to find largest rectangular area in a Histogram. Problem Given an Integer representing number of bars in a Histogram and an array of integers representing the height of the bars […]

  • 30 January

    Difference between early binding and late binding in java

    Binding in Java refers to the process of associating a method or function body with a method or function call by the Java Compiler. In simpler words, when a function is called by the Java compiler the task of correctly locating the method for the respective function is binding. Depending on when the compiler is […]

  • 29 January

    Count subtrees with Sum equal to target in binary tree

    If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post, we will see about how to count subtrees with Sum equal to target in binary tree Problem Given a Binary tree and an integer. You need to find the number of subtrees having the […]

  • 20 November

    Serialize and Deserialize n-ary tree

    If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. Problem Given a Generic Tree, Serialize and Deserialize it. Serialization is a basically a representation of a tree in a String format which takes much lesser space than storing the tree itself. Deserialization is constructing the actual tree […]

  • 12 November

    Segment Tree 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 Segment Tree in java. Problem Consider an Array of Integers, int[] arr = {a1, a2, a3, a4, a5,….., an}; Given two types of queries, (i) In the first type of query, […]

  • 22 October

    Sliding Window Maximum 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 Sliding Window Maximum in java Problem Given an Array of integers and an Integer k, Find the maximum element of from all the contiguous subarrays of size K. For eg : […]

  • 21 October

    Difference between equals() and == in java

    In this post, we will see about the difference between equals and == in java. This is most asked java interview question for fresher or 2-year experienced java developer and it might be confusing sometimes. Let’s try to understand each quickly. Equality operator “==” Equality operator can be used to compare primitives but when you […]

  • 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 […]