Author: Arpit Mandliya
- 20 February
Inorder Successor in a Binary Search Tree
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 Inorder Successor in a Binary Search Tree. Problem Given a Binary Search Tree and a target node value. Find the Inorder successor of the given node value in the […]
- 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, […]
- 06 February
Java FileWriter Example
The FileWriter class of java.io package makes writing to files in Java as easy as A-B-C. The FileWriter class writes to files as a stream of characters instead of bytes(as in FileOutputStream). Like its input-oriented counterpart FileReader, the FileWriter class is intended for writing “text” based files one character at a time. Let us look […]
- 05 February
Java program to find permutation and combination (nCr nPr)
In this tutorial, we will see java program to find permutation and combination. Permutation is represented as nPr and Combination is represented as nCr.It is simple program which involves factorial of the numbers. Here is formula to find permutation and combination (nCr nPr). nPr = factorial(n) / factorial(n-r) nCr = factorial(n)/(factorial(n-r) * factorial(r)) [crayon-678849751b545649672075/] Output: Enter […]
- 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 […]
- 02 February
Longest common Subsequence
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. Given two Strings A and B. Find the length of the Longest Common Subsequence (LCS) of the given Strings. Subsequence can contain any number of characters of a string including zero or all (subsequence containing zero characters is […]
- 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 […]
- 18 January
Sed Command in unix
Sed (Stands for stream editor) is a command line utility to modify each line of a file or stream matching a specified string. It makes basic text changes to a file or input from a pipeline. Sed command can perform variety of functions on file like, searching, find and replace, insertion or deletion. Most common […]