lecture17

Lecture17 - CS111 Intro to Computer Science Lecture 17 Data in Objects Linked Lists CS111 Slides for Prof Steinbergs lecture Lecture 17 1 Review

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 1 Lecture 17 CS111: Intro to Computer CS111: Intro to Computer Science Science Lecture 17 Data in Objects Linked Lists
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 2 Lecture 17 Review: 2-Dimensional arrays Review: 2-Dimensional arrays Suppose you have a class of 3 students, each student takes 5 quizzes, and you want to get The sum over all students of the scores on quiz 1, 2, 3, 4, and 5 The sum over all quizzes of the scores of students 1, 2, and 3
Background image of page 2
CS111: Slides for Prof. Steinberg ʼ s lecture 3 Lecture 17 2-Dimensional arrays 2-Dimensional arrays Like 1-D arrays: separately create Variable to refer to the array int [ ] [ ] scores The array itself scores = new int [5] [3] A 2-D array is an array of 1-D arrays
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 4 Lecture 17 length length scores. length is number of rows scores[r]. length is length of row r, I.e. # of columns Note no ( ) after length, unlike eg String word = “abc”; … word.length ( )
Background image of page 4
CS111: Slides for Prof. Steinberg ʼ s lecture 5 Lecture 17 Nested Loops Nested Loops To think about where to put things in a program with nested loops, ask how many times does it happen To sum the columns of a 2-D array, where do you set sum=0?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/01/2011 for the course 198 111 at Rutgers.

Page1 / 20

Lecture17 - CS111 Intro to Computer Science Lecture 17 Data in Objects Linked Lists CS111 Slides for Prof Steinbergs lecture Lecture 17 1 Review

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online