Awesome q2a theme
0 votes
50 views
The 2d array is given as A[0...39,0...39].What is the location of A[15][25] if row major order is followed along with lower triangular matrix?base address is 500 and char takes 1byte of memory.
in Programming by (6 points) | 50 views
0
629?

1 Answer

0 votes
I think 625?
by (41 points)
0
can you please explain me?
0
formula for the lower triangular matrix(row major): if the array is a[lb1...ub1][lb2...ub2] then

                               location(a[i][j])=base address+[(i-lb1)(i-lb1+1)/2 + (j-lb2)]*size of the element
0
using this formula i think its 645...
0
500+[(15-0)(15-0+1)/2 + (25-0)]*1=500+120+25=645

whar is the answer?
0
according to them it should be 696...
0
500+(15-0)(25-0+1)/2+16-(39-25+1)=696

the did this
0
is it possible to get two different answers if  we solve using the lower triangular matrix on the left side or calculate  by using lower triangular matrix on the right side?
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Jul 2020
  1. Shaik Masthan

    39 Points

  2. hiteshpujari

    9 Points

  3. fazin

    7 Points

  4. srestha

    7 Points

  5. gaurav2697

    6 Points

  6. Venkatesh Akhouri

    6 Points

  7. Meghana518

    6 Points

  8. athenahermes

    6 Points

  9. bittujash

    6 Points

  10. Pawan_k

    6 Points

7,560 questions
1,783 answers
10,868 comments
90,493 users