Given a sorted array and a value x, the ceiling of x is the smallest element in array greater than or equal to x, and the floor is the greatest element smaller than or equal to x. Assume than the array is sorted in non-decreasing order. Write efficient functions to find floor and ceiling of x. Examples :...
Given a binary array sorted in non-increasing order, count the number of 1’s in it....
Given an array arr[] of N integers and Q queries of the form {X, Y} of the following two types:...
jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxBarcode is used to indicate a widget that can display various forms of bar codes....
Given an array arr[]. Find the maximum value of prefix sum which is also suffix sum for index i in arr[]....
Given an array arr[]. Find the maximum value of prefix sum which is also suffix sum for index i in arr[]....
You are given an array A[] of n-elements and a positive integer k (k > 1). Now you have find the number of pairs Ai, Aj such that Ai = Aj*(kx) where x is an integer. Note: (Ai, Aj) and (Aj, Ai) must be count once.Examples :...
Given two permutations P1 and P2 of numbers from 1 to N, the task is to find the maximum count of corresponding same elements in the given permutations by performing a cyclic left or right shift on P1. Examples:...
jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxBarcode is used to indicate a widget that can display various forms of bar codes....
Given an array arr[] consisting of N integers, the task is to sort the array in non-increasing order by minimum number of anti-clockwise rotations. If it is not possible to sort the array, then print “-1”. Otherwise, print the count of rotations....
AngularJS, a widely used JavaScript framework, has transformed web development by enabling the creation of dynamic and interactive single-page applications (SPAs). However, the architecture of SPAs, which relies heavily on client-side rendering, poses challenges for search engines. In this article, we’ll delve into the intricacies of how search engines deal with AngularJS applications, ensuring that the content within these applications is properly indexed and ranked....
jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxBarcode is used to indicate a widget that can display various forms of bar codes....