edited by
9,751 views
55 votes
55 votes

An $n \times n$ array $v$ is defined as follows:

$v\left[i,j\right] = i - j$ for all $i, j, i \leq n, 1 \leq j \leq n$

The sum of the elements of the array $v$ is

  1. $0$
  2. $n-1$
  3. $n^2 - 3n +2$
  4. $n^2 \frac{\left(n+1\right)}{2}$
edited by

8 Answers

4 votes
4 votes
ans is option (a) i.e 0

solution: suppose if n=3

then i<=3 and 1<=j<=3

i.e i=1,2,3, and j=1,2,3

=> v={i-j}=(0,-1,-2,1,0,-1,2,1,0}

sum of elements in v=0
edited by
0 votes
0 votes
Answer is Option----A

Assume n=2;

then the condition is i<=2 and 1<=j<=2

now the values are i={1,2} and j={1,2}

Given, v[i] [j]= i-j;

now the values will be v ={1-1,1-2,2-1,2-2};

v={0,-1,1,0};

sum of all values present in v is 0..
0 votes
0 votes

An n x n array v is defined as follows: v[i, j] = i - j for all i, j, 1 < i < n, 1 < j < n.The sum of the elements of the array v is. 0.

( A ) IS ANSWER

Answer:

Related questions

33 votes
33 votes
8 answers
2
Kathleen asked Sep 14, 2014
10,862 views
Consider the following nested representation of binary trees: $(X \ Y \ Z)$ indicates $Y$ and $Z$ are the left and right subtrees, respectively, of node $X$. Note that $Y...
48 votes
48 votes
4 answers
3
Kathleen asked Sep 14, 2014
17,509 views
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal respectively, of a complete binary tree. Which of the foll...