Algorithm Interview
- 12 August
Memoization example in java
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this tutorial, we will see about Memoization example in java. Let me start with the question. Would you like to do same task again and again when you know that it is going to give you same […]
- 12 August
Intersection of two linked lists
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 how to find Intersection of two linked lists. Problem Given two singly linked lists, find if two linked lists intersect. If they intersect, find intersection point. Solution Here is simple algorithm to […]
- 04 August
LRU cache implementation 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 LRU cache implementation in java. Problem Design a Least recently used cache implementation in java. It should have below properties. bounded size: It should have bounded size to take care of memory limits. […]
- 01 August
Count Factorial Trailing Zeroes in java
In this tutorial, we will see how to count trailing zeros in factorial of a number in java. Problem Count number of zeros in factorial of number in java. For example: Factorial of 6 is 720, so a number of trailing zeros is 1. Factorial of 14 is 87 178 291 200, so a number […]
- 14 June
Longest Substring Without Repeating Characters
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this tutorial, we will see Find Longest Substring Without Repeating Characters in java. Problem We need to find Longest Substring Without Repeating Characters Solution Brute force solution Find all the substring and check the Longest Substring Without […]
- 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-6767bd59742a8526469350/] 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-6767bd597433e648455654/] 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 […]
- 08 November
Dijkstra’s algorithm 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 Dijkstra algorithm for find shortest path from source to all other vertices. Problem You will be given graph with weight for each edge,source vertex and you need to find minimum distance from […]