Chapter 3: Problem 20
Suppose a metropolitan area is divided into four school restricts: \(1,2,3,4\). The Seate Beard af Etupcation beeppos tack of the number of student transfers fram ane district ted ancether and the shudent transiers within a district. This information is nesorded each year in a \(4 x\) table ss shown here. The entry in row 1 , cohimn \(3 \mid 314\), for exsmple, stiows the number of student tronefers trom district 1 to district 3 for the yeary the entry in now 1 , wien w.column \(1(243)\) shows the number of student transfers within district 1 . \begin{tabular}{l|llll} & 1 & 2 & 3 & 4 \\ \hline 1 & 243 & 187 & 314 & 244 \\ 2 & 215 & 420 & 345 & 172 \\ 3 & 197 & 352 & 385 & 261 \\ 4 & 340 & 135 & 217 & 344 \end{tabular} Suppose there are \(n\) school districts, and the Board of Education maintains an \(n \times n\) table. a. Write a pseudocode algorithm to print the table, that is, to print each of the entries in the table. Write an expression for the number of print statements the algorithm executes. b. Write a pseudocode algorithm to print \(n\) copies of the table, one to give to each of the \(n\) school district supervisors. Write an expression for the number of print statements the algorithm executes. c. What is the order of magnitude of the work done by the algorithm in part \(b\) if the unit of work is printing a table element?
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.