GeekInterview.com
Series: Subject: Topic:
Question: 29 of 51

Array Values Algorithms

How many values can be held by an array with dimensions A(0:n), B(-1:n,1:m), C(-n:0,2)?
Asked by: francislawrance | Member Since Jan-2009 | Asked on: Jan 4th, 2009

View all questions by francislawrance

Showing Answers 1 - 1 of 1 Answers
imithya

Answered On : Aug 16th, 2009

View all answers by imithya


A(0:n) = n+1 elements

-1 specifies that the array indexing starts at '-1' uptill 'n'. Therefore, there can be "n-(-1)+1 = n+2" rows in the array. Each of this row may hold upto m (m-1+1) elements. Therefore, B(-1:n, 1:m) = (n+2)*(m) elements

Similarly,
C(-n:0, 2) = (n+1)*(3) elements

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.