Array
- 03 October
Stock Buy Sell to Maximize Profit
If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. Given an array of integers representing stock price on a single day, find max profit that can be earned by 1 transaction. So you need to find a pair (buyDay,sellDay) where buyDay < = sellDay and it […]
- 03 October
Search in a row wise and column wise sorted matrix
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. Problem : Given row wise and column wise sorted matrix ,we need to search element with minimum […]
- 03 October
Find all pairs of elements from an array whose sum is equal to given number
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. Problem : Given a  array,we need to find all pairs whose sum is equal to number X. For example: [crayon-6729f5b185648086180330/] Solution : Solution 1: You can check each and every pair of numbers and find the […]
- 01 October
Given a sorted array and a number x, find the pair in array whose sum is closest to x
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. Problem : Given a sorted array,we need to find a pair whose sum is closed to number X in Array. For example: [crayon-6729f5b1857ed124553607/] Solution : Solution 1: You can check each and every pair of numbers […]
- 01 October
Find a Pair Whose Sum is Closest to zero in Array
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. Problem : Given array of +ve and -ve integers ,we need to find a pair whose sum is closed to Zero in Array. For example: [crayon-6729f5b18594a322641746/] Solution : Solution 1: You can check each and every […]
- 29 September
find transpose of a matrix in java
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we will see how to find transpose of matrix in java. Transpose of matrix? A matrix which is created by converting all the rows of a given matrix into columns and vice-versa. Below […]
- 28 September
Minimum Number of Platforms Required for A Railway Station
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Introduction to Problem You are given arrival and departure time of trains reaching to a particular station. You need to find minimum number of platforms required to accommodate the trains at any point of time. […]
- 26 September
Find the number occurring odd number of times in an array
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we will see how to find number occurring odd number of times in the array. Problem: You are given a array of integer. All numbers occur even number of times except one. You […]
- 24 September
Java Program to Find Second Largest Number in An Array
If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Overview In this post, we will see how to find the second largest number in an array. This is a one of common interview questions on array data structure. 2. Introduction to Problem Statement Given […]