|

Search results for array, subset



Cubic array

Posted by CMaster
Given a cubic array made up of NxNxN smaller cubes: the cubic array is N cubes wide, N cubes deep and N cubes high. Question: How many cubes are on ...
Question:

Given an array of integers A[N], find the maximum value of (j-k) such that A[k] <= A[j] & j>k
Answer in C# public static int FindMax( int[] input ) { int max = Int32.MinValue; for ( int i = 0; i < input.length; i++ ) { if ( i ...
Answer The solution, while being extremely simple, sometimes confuses many people because of the necessity of maintaining an array index for the nex ...
Write a function to find a largest sub-sequence in a given array of integers both positive and negative. Examples: { -100, 1, 2, 3, -20, -20, -20, ...
Linked lists allow only sequential access to elements O(n) while arrays allow random access O(1). Linked lists requires an extra storage for reference ...
The main difference between the linked list and the array is that while the array is a static data structure (with fix number of elements). On the oth ...
for example the input array is [-10, 10, -2, 10], in this case the sub array that has the biggest summ is [10, -2, 10], which is 18.