Javascript Program for Largest Sum Contiguous Subarray
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum....
read more
Javascript Program To Merge Two Sorted Lists (In-Place)
Given two sorted lists, merge them so as to produce a combined sorted list (without using extra space).Examples:...
read more
Javascript Program For Finding Subarray With Given Sum – Set 1 (Nonnegative Numbers)
Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples :...
read more
JavaScript program to check whether a given number is power of 2
Given a positive integer n, write a function to find if it is a power of 2 or not...
read more
Javascript Program to Count pairs with given sum
Given an array of integers, and a number ‘sum’, find the number of pairs of integers in the array whose sum is equal to ‘sum’....
read more
Javascript Program for Search an element in a sorted and rotated array
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
read more
Javascript Program to Sort an array in wave form
Given an unsorted array of integers, sort the array into a wave like array. An array ‘arr[0..n-1]’ is sorted in wave form if arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] >= ….....
read more
Php Program for Count pairs with given sum
Given an array of integers, and a number ‘sum’, find the number of pairs of integers in the array whose sum is equal to ‘sum’....
read more
Php Program For Finding Subarray With Given Sum – Set 1 (Nonnegative Numbers)
Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples :...
read more
A program to check if a Binary Tree is BST or not
A Binary Search Tree (BST) is a node-based binary tree data structure that has the following properties....
read more
Search an element in a sorted and rotated Array
Given a sorted and rotated array arr[] of size N and a key, the task is to find the key in the array....
read more
Count total set bits in all numbers from range L to R
Given two positive integers L and R, the task is to count the total number of set bits in the binary representation of all the numbers from L to R....
read more