Search results for array


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 ...
Full question: You are standing in a corridor with N closed doors. The person walks by you and opens every door. Then the second person walks by an ...
Answer Binary search tree (BST) is a binary tree which has the following properties: 1. Tree is a binary tree 2. The left subtree of a node conta ...
Company where asked this question: Amazon
Interviewed for position: SDE, SDET
Question:

Given an array of integers A[N], find the maximum value of (j-k) such that A[k] <= A[j] & j>k
Full question: You have a vector of signed integers and you need to support an API with two exposed methods, insert(int) and getmedian(). Describe a ...
Interviewed for position: SDE
Answer Note: array should be sorted or Binary search won't work ! int binarySearch(int arr[],int size, int item) { int left, right, middle; left = 0 ...
Answer in C# public static int FindMax( int[] input ) { int max = Int32.MinValue; for ( int i = 0; i < input.length; i++ ) { if ( i ...
Stack and Query structures in computing are extremely fundamental and important. Then interviewing I expect candidate to fully understand this data s ...