Tag Archives: Arrays

Find the closest pair from two arrays 

Problem Given two sorted arrays and an integer X, find one number from each array such that the sum of these two numbers is the lowest possible. Approach 1 Since the arrays are sorted, we can decrement values one by one from the first array and find the remaining element in the second array. For example, if the… Read More »

JavaScript Arrays

Arrays in JavaScript are used to store multiple values using a single variable name. In this JavaScript tutorial, you will learn how to create and use Arrays in JavaScript. What are Arrays? An array is a collection of multiple values under a single variable name. In the previous tutorials, we learned about JavaScript primitive data types such as… Read More »

PHP – Arrays

PHP – Arrays Arrays are a type of data structure that allows you to store a number of elements having the same data type using a variable. By using an array the use of multiple variables for each value can be avoided. Arrays are easy to use and parse using an index value. You can easily handle when… Read More »

C++ Arrays

An Array is a collection of similar data types (homogenous data type) elements that store at a contiguous memory location and using the indices or index values we can access the random element from that collection. An array is only capable of storing similar data type which means if we have an array of integer, so only integer… Read More »