Given 2 sorted arrays A and B of size N each. Print the sum of the middle elements of the array obtained after merging the given arrays. Examples: Input: arr1: 1 2 ...read more
There is an array arr[] of length N. Your task is to find the sum of the minimum elements of each possible sub-array of the array. Examples: Input : arr[] = {2, ...read more
Given an array arr[] of n positive integers and q queries, in which each query have an integer k. For each query, the task is to output the minimum size of subarray ...read more
Given a sorted rotated array, the task is to find index of minimum element of the array. Following solution assumes that all elements are distinct. Examples: Input : arr[] = {5, 6, ...read more
What and Why? Algorithms are a well-ordered sequence of instructions that are used to solve a particular problem. The algorithm design technique is a strategy of developing an efficient algorithm to solve ...read more
Given an array of integers, write a function that returns true if there is a triplet (a, b, c) that satisfies a2+b2=c2 Example: Input: arr[] = {8, 1, 4, 6, 10} Output: ...read more
Given a string find the character which occurs a minimum number of times. Note: If multiple such characters exist output anyone. Example: Input: S = abbccdd Output: a As frequency of every ...read more
Write an efficient C program to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum. Examples: Input : {-2, -3, 4, -1, -2, 1, ...read more
C is a programming language developed by Dennis Ritchie in 1972. It has a significant historical impact. It was originally created at Bell Laboratories of AT&T Labs for building the UNIX operating ...read more
OOPs stands for Object Oriented Programming. OOP is a programming style with Classes, Objects, Inheritance, Polymorphism, Encapsulation, Abstraction. Before OOP, Procedural Programming like C was used, based on functions. C++ introduced OOP ...read more