SlideShare a Scribd company logo
1 of 2
2D-Array
How is the address of an individual element of a 2-dimensional array computed? What if a
rowpointer
layout is used instead? How does the address calculation change if the row or column
index can begin at a value other than 0?
Solution
The address of individual element in 2d array can be computed using below metods
1, Row Major System:
The address of a location in Row Major System is calculated using the following formula:
Address of A [ I ][ J ] = B + W * [ N * ( I – Lr ) + ( J – Lc ) ]
2. Column Major System:
The address of a location in Column Major System is calculated using the following formula:
Address of A [ I ][ J ] Column Major Wise = B + W * [( I – Lr ) + M * ( J – Lc )]
Where,
B = Base address
I = Row subscript of element whose address is to be found
J = Column subscript of element whose address is to be found
W = Storage Size of one element stored in the array (in byte) (Integer/float, etc)
Lr = Lower limit of row/start row index of matrix, if not given assume 0 (zero)
Lc = Lower limit of column/start column index of matrix, if not given assume 0 (zero)
M = Number of row of the given matrix
N = Number of column of the given matrix
2D-Array How is the address of an individual element of a 2-dimensiona.docx

More Related Content

Similar to 2D-Array How is the address of an individual element of a 2-dimensiona.docx

Similar to 2D-Array How is the address of an individual element of a 2-dimensiona.docx (20)

ds 2Arrays.ppt
ds 2Arrays.pptds 2Arrays.ppt
ds 2Arrays.ppt
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
 
data structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxdata structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptx
 
Data Structure and Algorithms Arrays
Data Structure and Algorithms ArraysData Structure and Algorithms Arrays
Data Structure and Algorithms Arrays
 
2D-Arrays
2D-Arrays2D-Arrays
2D-Arrays
 
data structure and algorithm Array.pptx btech 2nd year
data structure and algorithm  Array.pptx btech 2nd yeardata structure and algorithm  Array.pptx btech 2nd year
data structure and algorithm Array.pptx btech 2nd year
 
Data structures Lecture no.6
Data structures Lecture no.6Data structures Lecture no.6
Data structures Lecture no.6
 
Multi dimensional array
Multi dimensional arrayMulti dimensional array
Multi dimensional array
 
03-Lists.ppt
03-Lists.ppt03-Lists.ppt
03-Lists.ppt
 
DSA Unit II array.pptx
DSA Unit II array.pptxDSA Unit II array.pptx
DSA Unit II array.pptx
 
Array 2
Array 2Array 2
Array 2
 
Bcsl 033 solve assignment
Bcsl 033 solve assignmentBcsl 033 solve assignment
Bcsl 033 solve assignment
 
PPT Lecture 2.2.1 onn c++ data structures
PPT Lecture 2.2.1 onn c++ data structuresPPT Lecture 2.2.1 onn c++ data structures
PPT Lecture 2.2.1 onn c++ data structures
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
array.pptx
array.pptxarray.pptx
array.pptx
 
cluod.pdf
cluod.pdfcluod.pdf
cluod.pdf
 
List - Operations and Implementation
List - Operations and ImplementationList - Operations and Implementation
List - Operations and Implementation
 
Two Dimentional Array
Two Dimentional ArrayTwo Dimentional Array
Two Dimentional Array
 
8074.pdf
8074.pdf8074.pdf
8074.pdf
 
Linked lists 1
Linked lists 1Linked lists 1
Linked lists 1
 

More from carold12

In scilab Write a function named countDown that accepts a total time T.docx
In scilab Write a function named countDown that accepts a total time T.docxIn scilab Write a function named countDown that accepts a total time T.docx
In scilab Write a function named countDown that accepts a total time T.docxcarold12
 
In managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docxIn managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docxcarold12
 
in Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docxin Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docxcarold12
 
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docxIn Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docxcarold12
 
In Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docxIn Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docxcarold12
 
In its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docxIn its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docxcarold12
 
in thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docxin thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docxcarold12
 
In the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docxIn the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docxcarold12
 
In this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docxIn this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docxcarold12
 
In the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docxIn the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docxcarold12
 
In the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docxIn the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docxcarold12
 
3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docx3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docxcarold12
 
3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docxcarold12
 
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docxcarold12
 
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docxcarold12
 
25- Question Part Points Submissions Used 1.docx
25-       Question Part   Points   Submissions Used         1.docx25-       Question Part   Points   Submissions Used         1.docx
25- Question Part Points Submissions Used 1.docxcarold12
 
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docxcarold12
 

More from carold12 (17)

In scilab Write a function named countDown that accepts a total time T.docx
In scilab Write a function named countDown that accepts a total time T.docxIn scilab Write a function named countDown that accepts a total time T.docx
In scilab Write a function named countDown that accepts a total time T.docx
 
In managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docxIn managing processes within organizations- what type(s) of methodolog.docx
In managing processes within organizations- what type(s) of methodolog.docx
 
in Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docxin Java For any element in keysList with a value greater than 100- pri.docx
in Java For any element in keysList with a value greater than 100- pri.docx
 
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docxIn Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
In Iate 2012- the Micklaus Corporation was formed- The corporate chart.docx
 
In Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docxIn Fall 1999- people in the financial community were making their fina.docx
In Fall 1999- people in the financial community were making their fina.docx
 
In its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docxIn its income statement for the year ended December 31- 2014- Gavin Co.docx
In its income statement for the year ended December 31- 2014- Gavin Co.docx
 
in thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docxin thin layer chromatography aspirin and caffeine were used as spot- u.docx
in thin layer chromatography aspirin and caffeine were used as spot- u.docx
 
In the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docxIn the USA are we currently in a period of recession or inflation- Exp.docx
In the USA are we currently in a period of recession or inflation- Exp.docx
 
In this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docxIn this Discussion- you will be able to familiarize yourself with the.docx
In this Discussion- you will be able to familiarize yourself with the.docx
 
In the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docxIn the US economy we have two sectors- private and public sectors- In.docx
In the US economy we have two sectors- private and public sectors- In.docx
 
In the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docxIn the traditional systems development life cycle- users- Are importan.docx
In the traditional systems development life cycle- users- Are importan.docx
 
3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docx3) IR Spec When it comes to IR analysis- one can choose different meth.docx
3) IR Spec When it comes to IR analysis- one can choose different meth.docx
 
3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx
 
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
28- How does the total vapor pressure (VP) and freezing point (FP) of.docx
 
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
27- The Bohr m odel of the hydrogen atom includes which of the followi.docx
 
25- Question Part Points Submissions Used 1.docx
25-       Question Part   Points   Submissions Used         1.docx25-       Question Part   Points   Submissions Used         1.docx
25- Question Part Points Submissions Used 1.docx
 
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
3- Suppose that U-S- government actively uses the fiscal policy to fig.docx
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

2D-Array How is the address of an individual element of a 2-dimensiona.docx

  • 1. 2D-Array How is the address of an individual element of a 2-dimensional array computed? What if a rowpointer layout is used instead? How does the address calculation change if the row or column index can begin at a value other than 0? Solution The address of individual element in 2d array can be computed using below metods 1, Row Major System: The address of a location in Row Major System is calculated using the following formula: Address of A [ I ][ J ] = B + W * [ N * ( I – Lr ) + ( J – Lc ) ] 2. Column Major System: The address of a location in Column Major System is calculated using the following formula: Address of A [ I ][ J ] Column Major Wise = B + W * [( I – Lr ) + M * ( J – Lc )] Where, B = Base address I = Row subscript of element whose address is to be found J = Column subscript of element whose address is to be found W = Storage Size of one element stored in the array (in byte) (Integer/float, etc) Lr = Lower limit of row/start row index of matrix, if not given assume 0 (zero) Lc = Lower limit of column/start column index of matrix, if not given assume 0 (zero) M = Number of row of the given matrix N = Number of column of the given matrix