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 ...
Search results for array
Cubic array
Posted by CMaster
Question:
Given an array of integers A[N], find the maximum value of (j-k) such that A[k] <= A[j] & j>k
Given an array of integers A[N], find the maximum value of (j-k) such that A[k] <= A[j] & j>k
Find largest element in array
Posted by CMaster
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 ...
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.
