CS 1371 Lecture Notes - Lecture 4: Hard Coding, Matlab, Infinite Loop

57 views4 pages

Document Summary

Iteration in terms of computer science is the repetition of a block of code. For example, you would use iteration if you wanted to multiply all the elements in a vector together. Whereas you as a human might approach the problem all at once and do it all in one step, a computer would need to break it down. Iteration is useful so you don"t have to hard code everything or use any sort of brute force approach. You can just write an elegant loop to handle an issue once and then run the loop until all of the issues of the same type are solved. (we call the implementation of iteration a loop. ) Consider a sudoku problem wherein you have to check to see if a solution is actually a true solution. One aspect of the problem required that you check each 3-by-3 box to see if the numbers 1-9 were present.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions