Uninitialized pointers are known as wild pointers because they point to some arbitrary memory location and may cause a program to crash or behave unexpectedly....
In C, array parameters are treated as pointers mainly to,...
Given two arrays arr1[] and arr2[] sorted in ascending order and an integer K. The task is to find k pairs with the smallest sums such that one element of a pair belongs to arr1[] and another element belongs to arr2[]. The sizes of arrays may be different. Assume all the elements to be distinct in each array. Examples:...
Two pointers is really an easy and effective technique which is typically used for searching pairs in a sorted array.Given a sorted array A (sorted in ascending order), having N integers, find if there exists any pair of elements (A[i], A[j]) such that their sum is equal to X....
The Spiral/Clockwise Method is a magic tool for C/C++ programmers to define the meaning of syntax declaration in the head within seconds. This method was created by David Anderson and here is a short brief about how to apply this method....
An array of pointers is an array of pointer variables. It is also known as pointer arrays. We will discuss how to create a 1D and 2D array of pointers dynamically. The word dynamic signifies that the memory is allocated during the runtime, and it allocates memory in Heap Section. In a Stack, memory is limited but is depending upon which language/OS is used, the average size is 1MB....
Given an array arr[ ] of size N, the task is to find the rank of the remaining element in an array after performing the given operation:...
Prerequisite: Array BasicsIn C/C++, multidimensional arrays in simple words as an array of arrays. Data in multidimensional arrays are stored in tabular form (in row major order). Below is the general form of declaring N-dimensional arrays:...
Given a sorted array arr of size N, the task is to reduce the array such that each element can appear at most two times....
Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element....
Given N and M number of points on the straight line, denoting the positions of the customers and vendors respectively. Each vendor provides service to all customers, which are located at a distance that is no more than R from the vendor. The task is to find minimum R such that for each customer there is at least one vendor at the distance which is no more than R....