Question: Do This: Use the code segment below to answer the following questions. String [ ] [ ] classRosters = { { Keith, Juanita, David, Patricia

Do This: Use the code segment below to answer the following questions.
String[][] classRosters ={{ "Keith", "Juanita", "David", "Patricia"},
{ "Camren", "Joyce", "Nicole", "Maurice" },
{ "Denise", "Monique", "Juanita", "Kevin"}};
1. How many elements must be checked to find the string "Monique" when a row-major order traversal is performed on the classRosters array?
2. How many elements must be checked to find the string "Monique" when a column-major order traversal is performed on classRosters array?
3. Which traversal method located the string "Monique" using the least iterations?
4. How many elements must be checked to find the string "Kevin" when a row-major order traversal is performed on the classRosters array?
5. How many elements must be checked to find the string "Kevin" when a column-major order traversal is performed on the classRosters array?
6. Which traversal method located the string "Kevin" using the least iterations?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!