CSCI 1006 Lecture Notes - Lecture 12: Increment And Decrement Operators

32 views3 pages

Document Summary

It repeats the code until the test becomes false. It is not recursion, and thus does not eat up memory. A for loop is optimized for counter-based iteration. For (initialize counter; test; modify counter) { code }. For example for(int index = 0; index < a. length; index++). The initialize counter happens before looping, only once. The test is evaluated at the beginning of each iteration. The modification occurs at the end of every iteration. An array is a type of data structure. A data structure is a type of data used to store multiple pieces of information in one piece. An array is a contiguous block of memory used to store multiple values of a single type. Individual values are referenced by their index, or position in the array. The index starts at 0 and goes up to n 1, if there are n numbers. Indexes cannot be negative numbers; else they are invalid.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents