SlideShare a Scribd company logo
1 of 7
Two-Dimensional
Arrays
Chapter 11
11
What is a two-dimensional array?
A two-dimensional
array has “rows”
and “columns,”
and can be thought
of as a series of
one-dimensional
arrays stacked on
top of one another.
11
Declare a two-dimensional array:
int[][] anArray = new int[5][5];
Declaring a Two-Dimensional Array
11
Iterating a Two-Dimensional Array
Use a nested for loop:
Outer loop iterates the row
Inner loop iterates the column.
for ( int i=0; i<5; i++ )
{
for ( int j=0; j<5; j++ )
{
anArray[i][j] = i+j;
}
}
11
Multidimensional Arrays
Arrays can have more than two
dimensions.
Multidimensional arrays are not
commonly used as they quickly become
difficult to manage.
Declare multidimensional array:
int[][][] anArray = new
int[5][5][5];
11
Implementing Cellular Automata
One generation
per row
One-dimensional
array holds on/off
status of each cell
in each generation
11
The Game of Life
Using two-dimensional arrays:
Entire board is
one generation.
Two-dimensional
array holds state of
each cell of the game
board organized in
rows and columns.

More Related Content

What's hot

Ppt presentation of queues
Ppt presentation of queuesPpt presentation of queues
Ppt presentation of queuesBuxoo Abdullah
 
Queue data structure
Queue data structureQueue data structure
Queue data structureanooppjoseph
 
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابورالمحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابورMahmoud Alfarra
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structureMahmoud Alfarra
 
basics of queues
basics of queuesbasics of queues
basics of queuessirmanohar
 
Queues-and-CQueue-Implementation
Queues-and-CQueue-ImplementationQueues-and-CQueue-Implementation
Queues-and-CQueue-Implementationshaik faroq
 
Unit 1 LINEAR DATA STRUCTURES
Unit 1  LINEAR DATA STRUCTURESUnit 1  LINEAR DATA STRUCTURES
Unit 1 LINEAR DATA STRUCTURESUsha Mahalingam
 
Priority queue in DSA
Priority queue in DSAPriority queue in DSA
Priority queue in DSAjunnubabu
 
ds and algorithm session
ds and algorithm sessionds and algorithm session
ds and algorithm sessionVarun Garg
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesAndres Mendez-Vazquez
 

What's hot (20)

Queue
QueueQueue
Queue
 
Ppt presentation of queues
Ppt presentation of queuesPpt presentation of queues
Ppt presentation of queues
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
Queue
QueueQueue
Queue
 
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابورالمحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابور
 
Lecture7
Lecture7Lecture7
Lecture7
 
Algo>Abstract data type
Algo>Abstract data typeAlgo>Abstract data type
Algo>Abstract data type
 
Array in c#
Array in c#Array in c#
Array in c#
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 
Core java day2
Core java day2Core java day2
Core java day2
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structure
 
Sorting
SortingSorting
Sorting
 
basics of queues
basics of queuesbasics of queues
basics of queues
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Queues-and-CQueue-Implementation
Queues-and-CQueue-ImplementationQueues-and-CQueue-Implementation
Queues-and-CQueue-Implementation
 
Unit 1 LINEAR DATA STRUCTURES
Unit 1  LINEAR DATA STRUCTURESUnit 1  LINEAR DATA STRUCTURES
Unit 1 LINEAR DATA STRUCTURES
 
Priority queue in DSA
Priority queue in DSAPriority queue in DSA
Priority queue in DSA
 
ds and algorithm session
ds and algorithm sessionds and algorithm session
ds and algorithm session
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_types
 

Viewers also liked

Aad introduction
Aad introductionAad introduction
Aad introductionMr SMAK
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexityAbbas Ali
 
Data Structure Assignment help , Data Structure Online tutors
Data Structure Assignment help , Data Structure Online tutorsData Structure Assignment help , Data Structure Online tutors
Data Structure Assignment help , Data Structure Online tutorsjohn mayer
 
Mapping of one model into other model
Mapping of one model into other modelMapping of one model into other model
Mapping of one model into other modelratikaagarwal
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysisDr. Rajdeep Chatterjee
 
1 d 2d 3d 4d
1 d 2d 3d 4d1 d 2d 3d 4d
1 d 2d 3d 4ddr.f
 
Learning C++ - Pointers in c++ 2
Learning C++ - Pointers in c++ 2Learning C++ - Pointers in c++ 2
Learning C++ - Pointers in c++ 2Ali Aminian
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional arrayRajendran
 
Complexity analysis - The Big O Notation
Complexity analysis - The Big O NotationComplexity analysis - The Big O Notation
Complexity analysis - The Big O NotationJawad Khan
 
Big o notation
Big o notationBig o notation
Big o notationkeb97
 
Data structures and Big O notation
Data structures and Big O notationData structures and Big O notation
Data structures and Big O notationMuthiah Abbhirami
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Abhimanyu Mishra
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihmSajid Marwat
 

Viewers also liked (20)

Aad introduction
Aad introductionAad introduction
Aad introduction
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Data Structure Assignment help , Data Structure Online tutors
Data Structure Assignment help , Data Structure Online tutorsData Structure Assignment help , Data Structure Online tutors
Data Structure Assignment help , Data Structure Online tutors
 
2-D array
2-D array2-D array
2-D array
 
Mapping of one model into other model
Mapping of one model into other modelMapping of one model into other model
Mapping of one model into other model
 
Pf presntation
Pf presntationPf presntation
Pf presntation
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
 
1 d 2d 3d 4d
1 d 2d 3d 4d1 d 2d 3d 4d
1 d 2d 3d 4d
 
Two Dimentional Array
Two Dimentional ArrayTwo Dimentional Array
Two Dimentional Array
 
Learning C++ - Pointers in c++ 2
Learning C++ - Pointers in c++ 2Learning C++ - Pointers in c++ 2
Learning C++ - Pointers in c++ 2
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Complexity analysis - The Big O Notation
Complexity analysis - The Big O NotationComplexity analysis - The Big O Notation
Complexity analysis - The Big O Notation
 
Big o notation
Big o notationBig o notation
Big o notation
 
Data structures and Big O notation
Data structures and Big O notationData structures and Big O notation
Data structures and Big O notation
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Time complexity
Time complexityTime complexity
Time complexity
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
 
Pointer in c++ part1
Pointer in c++ part1Pointer in c++ part1
Pointer in c++ part1
 

More from Graham Royce (20)

Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Chapter 17
Chapter 17Chapter 17
Chapter 17
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
13 java in oracle
13 java in oracle13 java in oracle
13 java in oracle
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
 
My 3 min pitch pack
My 3 min pitch packMy 3 min pitch pack
My 3 min pitch pack
 

Recently uploaded

Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...
Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...
Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...Eticketing.co
 
Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...
Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...
Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...World Wide Tickets And Hospitality
 
IPL Betting ID: The best cricket ID provider | The best beting ID
IPL Betting ID: The best cricket ID provider | The best beting IDIPL Betting ID: The best cricket ID provider | The best beting ID
IPL Betting ID: The best cricket ID provider | The best beting IDsilverexchange id
 
Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...
Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...
Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...Eticketing.co
 
Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...
Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...
Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...World Wide Tickets And Hospitality
 
All You Need To Know About UEFA EURO 2024
All You Need To Know About UEFA EURO 2024All You Need To Know About UEFA EURO 2024
All You Need To Know About UEFA EURO 2024Goalthinker
 
Spain's Euro 2024 Hopes Dampened by Injuries.docx
Spain's Euro 2024 Hopes Dampened by Injuries.docxSpain's Euro 2024 Hopes Dampened by Injuries.docx
Spain's Euro 2024 Hopes Dampened by Injuries.docxEuro Cup 2024 Tickets
 
Spain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdf
Spain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdfSpain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdf
Spain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdfEticketing.co
 
Ozan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docx
Ozan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docxOzan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docx
Ozan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docxEuro Cup 2024 Tickets
 
Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...
Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...
Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...Eticketing.co
 
Turkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdf
Turkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdfTurkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdf
Turkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdfEticketing.co
 
Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...
Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...
Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...World Wide Tickets And Hospitality
 
Spain vs Italy Squad for Euro Cup Who should be in the starting lineup.docx
Spain vs Italy Squad for Euro Cup Who should be in the starting lineup.docxSpain vs Italy Squad for Euro Cup Who should be in the starting lineup.docx
Spain vs Italy Squad for Euro Cup Who should be in the starting lineup.docxEticketing.co
 
Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...
Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...
Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...World Wide Tickets And Hospitality
 
Belgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docx
Belgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docxBelgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docx
Belgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docxWorld Wide Tickets And Hospitality
 
Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...
Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...
Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...World Wide Tickets And Hospitality
 
Optimum Performance Training Model Overview
Optimum Performance Training Model OverviewOptimum Performance Training Model Overview
Optimum Performance Training Model OverviewAskXX.com
 
Resultados: XXXVII Gran Premio Internacional de Marcha Cantones de A Coruña ...
Resultados: XXXVII Gran Premio Internacional  de Marcha Cantones de A Coruña ...Resultados: XXXVII Gran Premio Internacional  de Marcha Cantones de A Coruña ...
Resultados: XXXVII Gran Premio Internacional de Marcha Cantones de A Coruña ...Judith Chuquipul
 
Techniques for those who create fantasy sports Developers
Techniques for those who create fantasy sports DevelopersTechniques for those who create fantasy sports Developers
Techniques for those who create fantasy sports DevelopersAndrew Mathew
 
Poland vs Netherlands Euro Cup Prediction, Stats and Team News.docx
Poland vs Netherlands Euro Cup Prediction, Stats and Team News.docxPoland vs Netherlands Euro Cup Prediction, Stats and Team News.docx
Poland vs Netherlands Euro Cup Prediction, Stats and Team News.docxEticketing.co
 

Recently uploaded (20)

Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...
Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...
Turkiye vs Portugal Euro 2024 Martinez Portugal’s squad without major surpris...
 
Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...
Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...
Italy Vs Albania Italy squad for Euro Cup 2024 Who should be in the starting ...
 
IPL Betting ID: The best cricket ID provider | The best beting ID
IPL Betting ID: The best cricket ID provider | The best beting IDIPL Betting ID: The best cricket ID provider | The best beting ID
IPL Betting ID: The best cricket ID provider | The best beting ID
 
Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...
Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...
Netherlands vs France Netherlands Euro 2024 Squad Who Will Play and Who Won't...
 
Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...
Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...
Albania Vs Spain Euro Cup 2024 Italy vs Albania Prediction, Stats & Team News...
 
All You Need To Know About UEFA EURO 2024
All You Need To Know About UEFA EURO 2024All You Need To Know About UEFA EURO 2024
All You Need To Know About UEFA EURO 2024
 
Spain's Euro 2024 Hopes Dampened by Injuries.docx
Spain's Euro 2024 Hopes Dampened by Injuries.docxSpain's Euro 2024 Hopes Dampened by Injuries.docx
Spain's Euro 2024 Hopes Dampened by Injuries.docx
 
Spain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdf
Spain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdfSpain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdf
Spain vs Italy Euro Cup Head-to-Head Records and Memorable Meetings.pdf
 
Ozan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docx
Ozan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docxOzan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docx
Ozan Tufan Eyes Turkey Return and Portugal Finalizes Euro 2024 Squad.docx
 
Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...
Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...
Romania vs Ukraine Prediction, Stats & Team News an early look at the Group E...
 
Turkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdf
Turkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdfTurkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdf
Turkiye vs Portugal Turkey's Quest for Redemption in the Euro 2024.pdf
 
Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...
Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...
Belgium Vs Romania Should Domenico Tedesco go with Lois Openda over Romelu Lu...
 
Spain vs Italy Squad for Euro Cup Who should be in the starting lineup.docx
Spain vs Italy Squad for Euro Cup Who should be in the starting lineup.docxSpain vs Italy Squad for Euro Cup Who should be in the starting lineup.docx
Spain vs Italy Squad for Euro Cup Who should be in the starting lineup.docx
 
Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...
Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...
Italy Vs Albania Italy Euro Cup 2024 squad Who will Luciano Spalletti take to...
 
Belgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docx
Belgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docxBelgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docx
Belgium Vs Romania First look at Romania UEFA at the start of EURO 2024.docx
 
Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...
Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...
Croatia Vs Albania Spain vs Croatia Prediction, Croatia odds-on favorites for...
 
Optimum Performance Training Model Overview
Optimum Performance Training Model OverviewOptimum Performance Training Model Overview
Optimum Performance Training Model Overview
 
Resultados: XXXVII Gran Premio Internacional de Marcha Cantones de A Coruña ...
Resultados: XXXVII Gran Premio Internacional  de Marcha Cantones de A Coruña ...Resultados: XXXVII Gran Premio Internacional  de Marcha Cantones de A Coruña ...
Resultados: XXXVII Gran Premio Internacional de Marcha Cantones de A Coruña ...
 
Techniques for those who create fantasy sports Developers
Techniques for those who create fantasy sports DevelopersTechniques for those who create fantasy sports Developers
Techniques for those who create fantasy sports Developers
 
Poland vs Netherlands Euro Cup Prediction, Stats and Team News.docx
Poland vs Netherlands Euro Cup Prediction, Stats and Team News.docxPoland vs Netherlands Euro Cup Prediction, Stats and Team News.docx
Poland vs Netherlands Euro Cup Prediction, Stats and Team News.docx
 

Chapter 11

  • 2. 11 What is a two-dimensional array? A two-dimensional array has “rows” and “columns,” and can be thought of as a series of one-dimensional arrays stacked on top of one another.
  • 3. 11 Declare a two-dimensional array: int[][] anArray = new int[5][5]; Declaring a Two-Dimensional Array
  • 4. 11 Iterating a Two-Dimensional Array Use a nested for loop: Outer loop iterates the row Inner loop iterates the column. for ( int i=0; i<5; i++ ) { for ( int j=0; j<5; j++ ) { anArray[i][j] = i+j; } }
  • 5. 11 Multidimensional Arrays Arrays can have more than two dimensions. Multidimensional arrays are not commonly used as they quickly become difficult to manage. Declare multidimensional array: int[][][] anArray = new int[5][5][5];
  • 6. 11 Implementing Cellular Automata One generation per row One-dimensional array holds on/off status of each cell in each generation
  • 7. 11 The Game of Life Using two-dimensional arrays: Entire board is one generation. Two-dimensional array holds state of each cell of the game board organized in rows and columns.