## Find first three largest elements in a given array

Objective: Given an array of integers, write an algorithm to find the first three largest elements in the array. Example: Int [] a = { 6, 8, 1, 9, 2, 1, 10}; Output: 10,...

Skip to content# Category: Arrays

## Find first three largest elements in a given array

## Find two smallest elements in a given array

## Front and Back Search in an Array

## Print all Unique elements in a given array

## Find Number of reverse pairs in an array

## Find first two largest elements in a given array

## Java Program to find Sum the elements of an Array

## Rotate the given array in cycles

## Heap Sort – Java Implementation

## Find no of reverse pairs in an array which is sorted in two parts in O(N)

## Stack Data Structure – Introduction and Implementation

## Bubble Sort and Optimized Bubble Sort- Java Implementation

## Linear Search Algorithm

## Maximum Difference between two elements in array – Largest Gap Problem

## Snake and Ladder Problem

@tutorialhorizon

Objective: Given an array of integers, write an algorithm to find the first three largest elements in the array. Example: Int [] a = { 6, 8, 1, 9, 2, 1, 10}; Output: 10,...

Objective: Given an array of integers, write an algorithm to find the two smallest elements in the array. Example: Int [] a = { 6, 8, 1, 9, 2, 10}; Output: 1, 2 Int...

Objective: Given an unsorted array of numbers and a number ‘x’, write a java program to search the number ‘x’ in the array and return its index else return -1. Example: Int [] a...

Objective: Given an array of integers which contains duplicates as well. Write a program to print all unique elements in the array. This problem is also referred as print all distinct elements in the...

Objective: Given an array of integers A[],find no of reverse pairs means no of (i, j) pairs where i < j and A[i]>A[j]. This problem is also asked as Count Inversions in an array....

Objective: Given an array of integers, write an algorithm to find the first two largest elements in the array. Example: Int [] a = { 6, 8, 1, 9, 2, 1, 10}; Output: 10,...

Objective: Given an array of integers, write a java program to find the sum of all elements Example: Input [] = {20, 30, 40, 10, 5, 2, 60, 73} Output: 240 Approach: Do a...

Objective: Given an array of integers, write a program to rotate the array in cyclic manner by one. Example: Int a [] = {1, 2, 3, 4, 5} Output: {2, 3, 4, 5, 1}...

What is Heap Sort?? Heap sort is comparison based sorting algorithm. Heap sort is considered as improved selection sort, it divides the input into sorted and unsorted region. The improvement from selection sort is...

Objective: Given an array of integers A[] which is sorted in two parts (both parts are individually sorted), find no of reverse pairs means no of (i, j) pairs where i belongs to the...

What is Stack?? Stack is an abstract data type (ADT) and very useful in programming. In computer science, a stack is an abstract data type that serves as a collection of elements. Majorly all the operations are done at only one...

In this article we will discuss about what is bubble sort, why it is considered as one of the simplest sorting algorithm, what its complexity, how we can improve the bubble sort algorithm. What...

Objective: Given an array [] of n elements and a element ‘x’, write a program to search an element ‘x’ in the array. Example: Input [] = {20, 30, 40, 10, 5, 2, 60,...

Objective: Given an array of numbers, write an algorithm to find the maximum difference between any two elements in the array. Example: Int [] a = {2, 8, 1, 6, 10, 4} Output: Maximum...

Objective – Given a snake and ladder game, write a function that returns the minimum number of jumps to take top or destination position. You can assume the dice you throw results in always...

%d bloggers like this: