CSSE 221: Fundamentals of Software Development Honors
Miniproject deliverables (new!)
Note: there will be some project deliverables due in class this week. Details on how to do each are in the Minproject folder in Angel.
These are due at the beginning of Monday's class.
- Problem statement and proposed solution: inalized documents should be in the repository.
- Iterative Enhancement Plan (IEP) with requirements: please email your prof when you submit them to the repos.
- Schedule: just add dates added to the IEP.
- Task List: add your excel spreadsheet, containing the tasks you have already done and those are about to do, to the repos.
Programming assignment (due by Sunday, 9:00am)
None yet! We'll be doing design and screenshots on Monday, then start
coding heavily next week.Written homework to do before week 5 (due before beginning of class on Monday, Oct 2).
Answers are to be written in your own words!
As usual, please bring hardcopy for written answers to class to hand in on Monday.
- Read chapters 12.2 (MergeSort), 11.3 (BinarySearch) in Savitch, and the packet on databases handled out in class.
- In *your own words*, explain clearly each of the following concepts:
- Database
- Transaction
- Query
- SQL
- JDBC
- Client
- Server
- Table
- Relational Database
- Find at least one example of a database that you interact with on a regular basis (meaning at least a couple times a week) and tell us about it.
Note: If you think that you don’t interact with any databases, then you are wrong!
- Say I have an unsorted database (stored as an array) with n keys and am searching to see if an arbitrary element is in the database…
- What is the name of the search algorithm you would use?
- What is the worst-case number of comparisons it needs to make (in terms of n) to find it or say it’s not in the database? When does this happen?
- Express (b) using big-Oh notation.
- What’s the best-case number of comparisons it needs to make (in terms of n) to find it or say it’s not in the database? When does this happen?
- What’s the average-case number of comparisons it needs to make (in terms of n) if I know the element is in the database?
- Express (e) using big-Oh notation.
- Why can’t I ask you to find the average number of comparisons the algorithm would need to make to find arbitrary elements not known to be in the database?
(This may be a bit subtle, just think…)
- Repeat parts a-d of the previous question, only now assume that the database/array is sorted, so you should use a more efficient search algorithm.
- With an array of 1,000,000,000 elements, what is the maximum number of comparisons made with binary search?
- We say that bubble sort is inefficient for large arrays. What do we mean, specifically, by "inefficient" sorting?
- The selection sort algorithm is still inefficient, but improves upon bubble sort in the number of swaps performed.
How many swaps does it make for an array of size n?
- Explain the mergesort algorithm in your own words.
Additional questions:
- What if we were sorting boxcars on the dock of a huge shipyard by a label on the outside of the car.
In this case, comparisons (running back-and-forth and checking labels) are cheap compared to swaps (which require a heavy-duty crane).
- What if we had 20 boxcars? Justify your choice of which sort would be best in this case.
- What if we had 1,000,000 boxcars? (Not practical, of course, but how would you reason about this?)
- Given the following list:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
perform a binary search for each of the following numbers and show all the comparisons you do to arrive at your answer.
For example, in (a), the first comparison should be between 5 and 10. Use the code shown in Savitch, p. 674, assuming the search starts at first =
0, last = a.length.
- 5
- 10
- 15
- 45
- What is the best, worst and average case complexity of merge sort? Explain.
- What is the advantage of using prepared statements for many similar queries?
Reminder that assistants are in Moench F217 from 7-9pm on Sunday through Thursday nights to help you, and that one assistant,
Thomas Root, has offered to help during other hours in his room (BSB004).