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)?

Questions by francislawrance

Showing Answers 1 - 4 of 4 Answers

imithya

  • Aug 16th, 2009
 


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

  Was this answer useful?  Yes

siddharth kumar

  • Aug 14th, 2013
 

how many value can be held by an array A(-3:10,5:12)

Nirbhay deep Trigunayat

  • Sep 17th, 2014
 

112

  Was this answer useful?  Yes

sweta sachan

  • May 22nd, 2017
 

Sir how would you calculate it? Please share the solution

  Was this answer useful?  Yes

Mark Webb

  • May 23rd, 2018
 

A: n+1
B: m(n+2)
C: 2(n+1)

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions