UNIT 5 - 2D Arrays

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

8 Terms

1
New cards

how to initialize a 2D array

dataType [][] varName = new dataType[row][column] (size of the array)

{{2,3,4}, {3, 4, 5}} to initialize to values

2
New cards

how to access a row in a 2D array?

array name and index number in bracket

3
New cards

how to access a value in a 2D array

name[][]

4
New cards

row-major traversal

(moving left to right and then down)

(row.length {

col[0]. length}}

5
New cards

what does array.length represent?

the NUMBER of rows in an array

6
New cards

what does array[0].length mean?

the number of elements in a row (the number of colums)

7
New cards

column major traversal

reading each column (top to bottom) then shifting right

8
New cards

what is the indexOf(String ch) method?

it tells you the index numbers of the specified string(remeber every string is an array with the characters starting at index 0

Explore top flashcards

October exam
Updated 465d ago
flashcards Flashcards (32)
10/6
Updated 218d ago
flashcards Flashcards (62)
PSCH 262 Final Exam
Updated 634d ago
flashcards Flashcards (110)
WWII
Updated 4d ago
flashcards Flashcards (35)
October exam
Updated 465d ago
flashcards Flashcards (32)
10/6
Updated 218d ago
flashcards Flashcards (62)
PSCH 262 Final Exam
Updated 634d ago
flashcards Flashcards (110)
WWII
Updated 4d ago
flashcards Flashcards (35)