Lecture 26 - Two Dimensional Array

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

7 Terms

1
New cards

how to define 2D arrays

  • int [][] A = new int [3][4];

  • in [] [] A = {{1,0,12},(1,2,3}};

2
New cards

How are Array stored in Ram

The Variable holds a reference to an array witch holds a reference to multiple other arrays

<p>The Variable holds a reference to an array witch holds a reference to multiple other arrays</p>
3
New cards

Recursion

  • a definition that quotes itself to define itself

4
New cards

Binary Search with Recursion

5
New cards

Hanoi Tower

  • move a tower of N disk from stack 0 to stack 1

  • only one disk can be moved at a time

  • solve the subproblem

  • move n-1 disk to stack 2

  • move nth disk from stack 0 to 1

  • move n-1 tack 2 to stack 1

<ul><li><p>move a tower of N disk from stack 0 to stack 1</p></li><li><p>only one disk can be moved at a time</p></li><li><p>solve the subproblem</p></li><li><p>move n-1 disk to stack 2</p></li><li><p>move nth disk from stack 0 to 1</p></li><li><p>move n-1 tack 2 to stack 1</p></li></ul><p></p>
6
New cards

Recursive Sorting Quick Sort

  • select middle item as pivot

  • put smaller items to the left, larger items to the right

  • quick sort the left, quicksort the right

  • one a subsequence only has one item, no sorting is required

7
New cards