CSCI 3322 (Principles of Algorithms), Fall 2022:
Reading Quiz 1

Credit:
10 points.

Reading

Be sure you have read, or at least skimmed, Chapter 2 of the textbook.

Instructions

Answer the questions below using only the readings for the course -- no Web searches. It's okay to talk to classmates about this assignment as you usually do, but I want each person to at least skim all the reading. Include the Honor Code pledge in what you turn in, either the full pledge or just the word “pledged”. For these quizzes by doing this you are also saying you have at least attempted all the reading it covers.

Please put the pledge in the same document as your answers, so I don't overlook it, and please be sure to include your name somewhere in the file, so when I print it for grading I know whose work it is.

You may write out your answers by hand and scan them, or you may use a word processor or other program, but please submit PDF or plain text in the “turn-in” folder I have set up for you on Google Drive. (So, no word-processor files and no links to other Google Docs.)

Questions

  1. (2.5 points) If A is an array, what does the textbook mean by A[1:10]?

  2. (2.5 points) If evaluating a boolean “and” or “or” in the textbook's pseudocode, are the expressions on either side of the operator both always evaluated?

  3. (2.5 points) In the analysis of insertion sort, what input results in best-case behavior? What input results in worst-case behavior?

  4. (2.5 points) Briefly explain why the textbook's MERGE algorithm takes time proportional to $n$ (array length).




2022-09-24